@firestartr/cli 1.43.2-snapshot-3 → 1.43.2-snapshot-5
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/build/index.js +16 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -284161,8 +284161,8 @@ async function downloadFeatureZip(repo, featureName, version, owner = 'prefapp')
|
|
284161
284161
|
}
|
284162
284162
|
const randomExtractPath = `/tmp/${catalog_common.generic.randomString(20)}`;
|
284163
284163
|
console.log(`Extracting feature ${featureName} version ${version} to ${randomExtractPath}`);
|
284164
|
-
await response.data;
|
284165
284164
|
external_fs_.rmSync(randomExtractPath, { recursive: true, force: true });
|
284165
|
+
await downloadZipBall(response.url, randomZipTmpPath);
|
284166
284166
|
const zip = new (adm_zip_default())(randomZipTmpPath);
|
284167
284167
|
const mainEntry = zip.getEntries()[0].entryName;
|
284168
284168
|
console.log(`Main entry in zip: ${mainEntry}`);
|
@@ -284179,6 +284179,21 @@ async function downloadFeatureZip(repo, featureName, version, owner = 'prefapp')
|
|
284179
284179
|
throw new Error(`Error for feature with tag ${featureName}-v${version}: ${error}. GitHub response: ${error}`);
|
284180
284180
|
}
|
284181
284181
|
}
|
284182
|
+
async function downloadZipBall(url, filePath) {
|
284183
|
+
try {
|
284184
|
+
const zipResponse = await fetch(url);
|
284185
|
+
if (!zipResponse.ok) {
|
284186
|
+
throw new Error(`Failed to download ZIP: ${zipResponse.statusText}`);
|
284187
|
+
}
|
284188
|
+
const zipBuffer = await zipResponse.text();
|
284189
|
+
external_fs_.writeFileSync(filePath, zipBuffer);
|
284190
|
+
const stats = external_fs_.statfsSync(filePath);
|
284191
|
+
console.dir(stats);
|
284192
|
+
}
|
284193
|
+
catch (err) {
|
284194
|
+
throw new Error(`Downloading feature's zip: ${err.message}`);
|
284195
|
+
}
|
284196
|
+
}
|
284182
284197
|
function buildRef(featureName, version) {
|
284183
284198
|
if (IS_SEMVER_REF.test(version)) {
|
284184
284199
|
return `${featureName}-v${version}`;
|