@criticalmanufacturing/cli 2.0.0-0 → 2.0.0-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/README.md +0 -2
- package/package.json +2 -1
- package/run.js +2 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@criticalmanufacturing/cli",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-5",
|
|
4
4
|
"description": "Critical Manufacturing command line client",
|
|
5
5
|
"bin": {
|
|
6
6
|
"cmf": "./run.js"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"debug": "^4.3.1",
|
|
34
34
|
"env-paths": "^2.2.1",
|
|
35
35
|
"is-installed-globally": "^0.4.0",
|
|
36
|
+
"is-path-inside": "^3.0.3",
|
|
36
37
|
"mkdirp": "^1.0.4",
|
|
37
38
|
"node_modules-path": "^2.0.5",
|
|
38
39
|
"rimraf": "^3.0.2",
|
package/run.js
CHANGED
|
@@ -5,6 +5,7 @@ const envPaths = require('env-paths');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
const isInstalledGlobally = require('is-installed-globally');
|
|
8
|
+
const isPathInside = require('is-path-inside');
|
|
8
9
|
const node_modules = require('node_modules-path');
|
|
9
10
|
const dbg = require('debug');
|
|
10
11
|
const { parsePackageJson, ARCH_MAPPING, PLATFORM_MAPPING } = require('./utils');
|
|
@@ -15,7 +16,7 @@ const debug = dbg("cmf:debug");
|
|
|
15
16
|
debug("Executing cmf-cli");
|
|
16
17
|
let exePath = null;
|
|
17
18
|
debug("Determining if cli is installed globally or locally...");
|
|
18
|
-
if (isInstalledGlobally) {
|
|
19
|
+
if (isInstalledGlobally || isPathInside(__dirname, process.env.APPDATA)) {
|
|
19
20
|
debug("cli is installed globally. Getting binary location from user profile...");
|
|
20
21
|
const paths = envPaths("cmf-cli", {suffix: ""});
|
|
21
22
|
exePath = path.join(paths.data, opts.binName);
|