@criticalmanufacturing/cli 5.10.8-0 → 6.0.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/npm-shrinkwrap.json +3590 -2075
- package/package.json +7 -7
- package/postinstall.js +11 -5
- package/run.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@criticalmanufacturing/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-1",
|
|
4
4
|
"description": "Critical Manufacturing command line client",
|
|
5
5
|
"bin": {
|
|
6
6
|
"cmf": "run.js"
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"adm-zip": "^0.5.12",
|
|
38
38
|
"axios": "^1.7.9",
|
|
39
|
-
"proxy-agent": "^5.0.0",
|
|
40
39
|
"debug": "^4.3.4",
|
|
41
40
|
"global-dirs": "3.0.0",
|
|
41
|
+
"http-proxy-agent": "^7.0.2",
|
|
42
|
+
"https-proxy-agent": "^7.0.6",
|
|
42
43
|
"mkdirp": "^2.1.6",
|
|
44
|
+
"proxy-agent": "^6.5.0",
|
|
45
|
+
"proxy-from-env": "^1.1.0",
|
|
43
46
|
"rimraf": "^3.0.2",
|
|
44
|
-
"tmp": "0.2.
|
|
45
|
-
"http-proxy-agent": "^5.0.0",
|
|
46
|
-
"https-proxy-agent": "^5.0.1"
|
|
47
|
+
"tmp": "^0.2.5"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"jest": "^
|
|
50
|
-
"proxy-from-env": "^1.1.0"
|
|
50
|
+
"jest": "^30.3.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/postinstall.js
CHANGED
|
@@ -7,14 +7,17 @@ const path = require('path'),
|
|
|
7
7
|
rimraf = require('rimraf'),
|
|
8
8
|
fs = require('fs'),
|
|
9
9
|
axios = require('axios'),
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
HttpsProxyAgentModule = require('https-proxy-agent'),
|
|
11
|
+
HttpProxyAgentModule = require('http-proxy-agent'),
|
|
12
12
|
proxyFromEnv = require('proxy-from-env'),
|
|
13
13
|
AdmZip = require("adm-zip"),
|
|
14
14
|
tmp = require('tmp'),
|
|
15
15
|
dbg = require('debug'),
|
|
16
16
|
{ parsePackageJson, PLATFORM_MAPPING, ARCH_MAPPING } = require('./utils');
|
|
17
17
|
|
|
18
|
+
const HttpsProxyAgent = HttpsProxyAgentModule.HttpsProxyAgent || HttpsProxyAgentModule;
|
|
19
|
+
const HttpProxyAgent = HttpProxyAgentModule.HttpProxyAgent || HttpProxyAgentModule;
|
|
20
|
+
|
|
18
21
|
const debug = dbg("cmf:debug");
|
|
19
22
|
const error = dbg("cmf:debug:error");
|
|
20
23
|
|
|
@@ -83,9 +86,12 @@ async function install(callback) {
|
|
|
83
86
|
var opts = parsePackageJson(".");
|
|
84
87
|
if (!opts) return callback(INVALID_INPUT);
|
|
85
88
|
console.info(`Copying the relevant binary for your platform ${process.platform}`);
|
|
86
|
-
const src= `./dist/${PLATFORM_MAPPING[process.platform]}-${ARCH_MAPPING[process.arch]}`;
|
|
89
|
+
const src = `./dist/${PLATFORM_MAPPING[process.platform]}-${ARCH_MAPPING[process.arch]}`;
|
|
90
|
+
const sourceBinaryPath = path.join(src, opts.binName);
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
// If dist exists but does not contain the expected binary for this platform,
|
|
93
|
+
// fetch the release archive and hydrate the platform folder.
|
|
94
|
+
if (!fs.existsSync(sourceBinaryPath)) {
|
|
89
95
|
// download respective release zip from github or fallback repositories
|
|
90
96
|
const primaryUrl = opts.binUrl.replace("{{version}}", opts.version).replace("{{platform}}", PLATFORM_MAPPING[process.platform]).replace("{{arch}}", ARCH_MAPPING[process.arch]);
|
|
91
97
|
const versionedFallbackName = `cmf-cli.${PLATFORM_MAPPING[process.platform]}-${ARCH_MAPPING[process.arch]}-${opts.version}.zip`;
|
|
@@ -126,7 +132,7 @@ async function install(callback) {
|
|
|
126
132
|
await execShellCommand(`robocopy ${src.replace(/\//g, "\\")} "${installPath}" /e /is /it`, [1]);
|
|
127
133
|
} else {
|
|
128
134
|
debug("Installing for *NIX: " + process.platform);
|
|
129
|
-
await execShellCommand(`cp -r ${src}
|
|
135
|
+
await execShellCommand(`cp -r ${src}/. "${installPath}"`);
|
|
130
136
|
await execShellCommand(`chmod +x "${installPath}/cmf"`);
|
|
131
137
|
}
|
|
132
138
|
await verifyAndPlaceBinary(opts.binName, installPath, callback);
|
package/run.js
CHANGED
|
File without changes
|