@criticalmanufacturing/cli 2.1.1 → 2.2.0-2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/run.js +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@criticalmanufacturing/cli",
3
- "version": "2.1.1",
3
+ "version": "2.2.0-2",
4
4
  "description": "Critical Manufacturing command line client",
5
5
  "bin": {
6
6
  "cmf": "./run.js"
package/run.js CHANGED
@@ -3,12 +3,11 @@
3
3
  const { spawn } = require('child_process');
4
4
  const envPaths = require('env-paths');
5
5
  const path = require('path');
6
- const fs = require('fs');
7
6
  const isInstalledGlobally = require('is-installed-globally');
8
7
  const isPathInside = require('is-path-inside');
9
8
  const node_modules = require('node_modules-path');
10
9
  const dbg = require('debug');
11
- const { parsePackageJson, ARCH_MAPPING, PLATFORM_MAPPING } = require('./utils');
10
+ const { parsePackageJson } = require('./utils');
12
11
 
13
12
  const opts = parsePackageJson(__dirname);
14
13
  const debug = dbg("cmf:debug");
@@ -16,7 +15,7 @@ const debug = dbg("cmf:debug");
16
15
  debug("Executing cmf-cli");
17
16
  let exePath = null;
18
17
  debug("Determining if cli is installed globally or locally...");
19
- if (isInstalledGlobally || isPathInside(__dirname, process.env.APPDATA)) {
18
+ if (isInstalledGlobally || isPathInside(__dirname, process.env.APPDATA || "dummy")) {
20
19
  debug("cli is installed globally. Getting binary location from user profile...");
21
20
  const paths = envPaths("cmf-cli", {suffix: ""});
22
21
  exePath = path.join(paths.data, opts.binName);