@akash-chowdhury-24/deployhub 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import archiver from 'archiver';
|
|
4
|
-
import axios from 'axios';
|
|
5
4
|
import { createLogger } from '../../../logger/index.js';
|
|
6
5
|
import {
|
|
7
6
|
runCli,
|
|
@@ -49,11 +48,18 @@ async function createRootZip(sourceDir, zipPath) {
|
|
|
49
48
|
* @param {string} uploadUrl
|
|
50
49
|
*/
|
|
51
50
|
async function uploadZipToAmplify(zipPath, uploadUrl) {
|
|
52
|
-
await
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const body = await fs.readFile(zipPath);
|
|
52
|
+
const response = await fetch(uploadUrl, {
|
|
53
|
+
method: 'PUT',
|
|
54
|
+
body,
|
|
56
55
|
});
|
|
56
|
+
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
const detail = await response.text().catch(() => '');
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Amplify zip upload failed: HTTP ${response.status}${detail ? ` — ${detail}` : ''}`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
/**
|