defang 0.5.40 → 0.5.42
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/clilib.js +4 -5
- package/package.json +1 -1
package/bin/clilib.js
CHANGED
|
@@ -104,14 +104,13 @@ function getLatestVersion() {
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function downloadAppArchive(
|
|
107
|
+
function downloadAppArchive(archiveFilename, outputPath) {
|
|
108
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
var
|
|
109
|
+
var downloadUrl, downloadTargetFile;
|
|
110
110
|
return __generator(this, function (_a) {
|
|
111
111
|
switch (_a.label) {
|
|
112
112
|
case 0:
|
|
113
|
-
|
|
114
|
-
downloadUrl = "https://github.com/".concat(repo, "/releases/download/v").concat(version, "/").concat(archiveFilename);
|
|
113
|
+
downloadUrl = "https://s.defang.io/".concat(archiveFilename, "?x-defang-source=npm");
|
|
115
114
|
downloadTargetFile = path.join(outputPath, archiveFilename);
|
|
116
115
|
return [4, downloadFile(downloadUrl, downloadTargetFile)];
|
|
117
116
|
case 1: return [2, _a.sent()];
|
|
@@ -357,7 +356,7 @@ function install(version, saveDirectory, os) {
|
|
|
357
356
|
_a.trys.push([0, 4, , 5]);
|
|
358
357
|
console.log("Getting latest defang cli");
|
|
359
358
|
filename = getAppArchiveFilename(version, os.platform, os.arch);
|
|
360
|
-
return [4, downloadAppArchive(
|
|
359
|
+
return [4, downloadAppArchive(filename, saveDirectory)];
|
|
361
360
|
case 1:
|
|
362
361
|
archiveFile = _a.sent();
|
|
363
362
|
if (archiveFile == null || archiveFile.length === 0) {
|