@command-center/command-center 0.7.3-rc0 → 0.7.3
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/command-center.js +33 -8
- package/package.json +7 -7
package/bin/command-center.js
CHANGED
|
@@ -116,6 +116,21 @@ function resolveBinaryInPackage(packageName, binaryName) {
|
|
|
116
116
|
return existsSync(binaryPath) ? binaryPath : null;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// Resolves a binary from the global npm prefix. This is needed because
|
|
120
|
+
// `require.resolve()` (scoped to the wrapper's location) cannot find
|
|
121
|
+
// globally-installed packages.
|
|
122
|
+
function resolveBinaryInGlobalPackage(packageName, binaryName) {
|
|
123
|
+
let globalRoot;
|
|
124
|
+
try {
|
|
125
|
+
globalRoot = execSync("npm root -g", { encoding: "utf8" }).trim();
|
|
126
|
+
} catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const binaryPath = path.join(globalRoot, packageName, "dist", binaryName);
|
|
131
|
+
return existsSync(binaryPath) ? binaryPath : null;
|
|
132
|
+
}
|
|
133
|
+
|
|
119
134
|
function resolveBinary() {
|
|
120
135
|
const entry = PLATFORM_PACKAGES.get(PLATFORM_KEY);
|
|
121
136
|
if (!entry) {
|
|
@@ -234,18 +249,28 @@ if (result.code === STATUS_ILLEGAL_INSTRUCTION && entry.fallbackPackageName) {
|
|
|
234
249
|
// Resolve or install fallback binary
|
|
235
250
|
// ####################
|
|
236
251
|
|
|
237
|
-
let fallbackPath =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
252
|
+
let fallbackPath =
|
|
253
|
+
resolveBinaryInPackage(
|
|
254
|
+
entry.fallbackPackageName,
|
|
255
|
+
entry.fallbackBinaryName,
|
|
256
|
+
) ??
|
|
257
|
+
resolveBinaryInGlobalPackage(
|
|
258
|
+
entry.fallbackPackageName,
|
|
259
|
+
entry.fallbackBinaryName,
|
|
260
|
+
);
|
|
241
261
|
|
|
242
262
|
if (!fallbackPath) {
|
|
243
263
|
const installed = installFallbackPackage(entry.fallbackPackageName);
|
|
244
264
|
if (installed) {
|
|
245
|
-
fallbackPath =
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
265
|
+
fallbackPath =
|
|
266
|
+
resolveBinaryInPackage(
|
|
267
|
+
entry.fallbackPackageName,
|
|
268
|
+
entry.fallbackBinaryName,
|
|
269
|
+
) ??
|
|
270
|
+
resolveBinaryInGlobalPackage(
|
|
271
|
+
entry.fallbackPackageName,
|
|
272
|
+
entry.fallbackBinaryName,
|
|
273
|
+
);
|
|
249
274
|
}
|
|
250
275
|
}
|
|
251
276
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@command-center/command-center",
|
|
3
|
-
"version": "0.7.3
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Binary distribution of UpToSpeed Command Center",
|
|
6
6
|
"bin": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@command-center/command-center-linux-arm64": "0.7.3
|
|
27
|
-
"@command-center/command-center-linux-x64": "0.7.3
|
|
28
|
-
"@command-center/command-center-macos-arm64": "0.7.3
|
|
29
|
-
"@command-center/command-center-macos-x64": "0.7.3
|
|
30
|
-
"@command-center/command-center-win-arm64": "0.7.3
|
|
31
|
-
"@command-center/command-center-win-x64": "0.7.3
|
|
26
|
+
"@command-center/command-center-linux-arm64": "0.7.3",
|
|
27
|
+
"@command-center/command-center-linux-x64": "0.7.3",
|
|
28
|
+
"@command-center/command-center-macos-arm64": "0.7.3",
|
|
29
|
+
"@command-center/command-center-macos-x64": "0.7.3",
|
|
30
|
+
"@command-center/command-center-win-arm64": "0.7.3",
|
|
31
|
+
"@command-center/command-center-win-x64": "0.7.3"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {}
|
|
34
34
|
}
|