@criticalmanufacturing/cli 5.9.0-0 → 5.9.0-1
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 +1 -1
- package/postinstall.js +6 -2
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -86,11 +86,15 @@ async function install(callback) {
|
|
|
86
86
|
if (!fs.existsSync("./dist")) {
|
|
87
87
|
// download respective release zip from github or fallback repositories
|
|
88
88
|
const primaryUrl = opts.binUrl.replace("{{version}}", opts.version).replace("{{platform}}", PLATFORM_MAPPING[process.platform]).replace("{{arch}}", ARCH_MAPPING[process.arch]);
|
|
89
|
+
const versionedFallbackName = `cmf-cli.${PLATFORM_MAPPING[process.platform]}-${ARCH_MAPPING[process.arch]}-${opts.version}.zip`;
|
|
90
|
+
const legacyFallbackName = `cmf-cli.${PLATFORM_MAPPING[process.platform]}-${ARCH_MAPPING[process.arch]}.zip`;
|
|
89
91
|
|
|
90
92
|
// Fallback URLs for alternative repositories
|
|
91
93
|
const fallbackUrls = [
|
|
92
|
-
`https://criticalmanufacturing.io/repository/tools
|
|
93
|
-
`https://
|
|
94
|
+
`https://criticalmanufacturing.io/repository/tools/${versionedFallbackName}`,
|
|
95
|
+
`https://criticalmanufacturing.io/repository/tools/${legacyFallbackName}`,
|
|
96
|
+
`https://repository.criticalmanufacturing.com.cn/repository/tools/${versionedFallbackName}`,
|
|
97
|
+
`https://repository.criticalmanufacturing.com.cn/repository/tools/${legacyFallbackName}`
|
|
94
98
|
];
|
|
95
99
|
|
|
96
100
|
// Try downloading from primary URL and fallbacks
|