dlw-machine-setup 0.15.0-test.1 → 0.15.0-test.2
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/bin/installer.js +3 -3
- package/package.json +1 -1
package/bin/installer.js
CHANGED
|
@@ -278,9 +278,9 @@ var import_path2 = require("path");
|
|
|
278
278
|
var import_child_process2 = require("child_process");
|
|
279
279
|
var MIN_FILE_SIZE = 1024;
|
|
280
280
|
async function downloadAndExtractAsset(token, asset, projectPath, tempDirName) {
|
|
281
|
-
return downloadAndExtractTgz(token, asset.url, asset.name, projectPath, tempDirName);
|
|
281
|
+
return downloadAndExtractTgz(token, asset.url, asset.name, projectPath, tempDirName, "application/octet-stream");
|
|
282
282
|
}
|
|
283
|
-
async function downloadAndExtractTgz(token, url, archiveName, projectPath, tempDirName) {
|
|
283
|
+
async function downloadAndExtractTgz(token, url, archiveName, projectPath, tempDirName, accept) {
|
|
284
284
|
const tarCheck = (0, import_child_process2.spawnSync)("tar", ["--version"], { stdio: "ignore" });
|
|
285
285
|
if (tarCheck.status !== 0) {
|
|
286
286
|
throw new Error("tar command not found. Please ensure tar is installed and available in your PATH.");
|
|
@@ -298,7 +298,7 @@ async function downloadAndExtractTgz(token, url, archiveName, projectPath, tempD
|
|
|
298
298
|
};
|
|
299
299
|
try {
|
|
300
300
|
const dlRes = await fetchWithRetry(url, {
|
|
301
|
-
headers: { "Accept":
|
|
301
|
+
headers: { "Accept": accept, "Authorization": `Bearer ${token}` }
|
|
302
302
|
});
|
|
303
303
|
if (!dlRes.ok) {
|
|
304
304
|
throw new Error(`Download failed: ${getReadableError(dlRes.status)}`);
|