@criticalmanufacturing/cli 5.10.6 → 5.10.8-0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@criticalmanufacturing/cli",
3
- "version": "5.10.6",
3
+ "version": "5.10.8-0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -2593,11 +2593,6 @@
2593
2593
  "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==",
2594
2594
  "dev": true
2595
2595
  },
2596
- "node_modules-path": {
2597
- "version": "2.3.0",
2598
- "resolved": "https://registry.npmjs.org/node_modules-path/-/node_modules-path-2.3.0.tgz",
2599
- "integrity": "sha512-lFrZ1gL5qFbmuDwSW7VOZpXaVoQ8NdsWh5MSpur/I2O5SqxjNjwBBvEu1KTjPZUaPzEFtfxG7+luZSIvS9b4JQ=="
2600
- },
2601
2596
  "normalize-path": {
2602
2597
  "version": "3.0.0",
2603
2598
  "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@criticalmanufacturing/cli",
3
- "version": "5.10.6",
3
+ "version": "5.10.8-0",
4
4
  "description": "Critical Manufacturing command line client",
5
5
  "bin": {
6
6
  "cmf": "run.js"
@@ -40,7 +40,6 @@
40
40
  "debug": "^4.3.4",
41
41
  "global-dirs": "3.0.0",
42
42
  "mkdirp": "^2.1.6",
43
- "node_modules-path": "^2.0.7",
44
43
  "rimraf": "^3.0.2",
45
44
  "tmp": "0.2.1",
46
45
  "http-proxy-agent": "^5.0.0",
package/postinstall.js CHANGED
@@ -13,7 +13,6 @@ const path = require('path'),
13
13
  AdmZip = require("adm-zip"),
14
14
  tmp = require('tmp'),
15
15
  dbg = require('debug'),
16
- node_modules = require('node_modules-path'),
17
16
  { parsePackageJson, PLATFORM_MAPPING, ARCH_MAPPING } = require('./utils');
18
17
 
19
18
  const debug = dbg("cmf:debug");
@@ -22,7 +21,10 @@ const error = dbg("cmf:debug:error");
22
21
  async function getInstallationPath() {
23
22
  debug("Getting installation path...");
24
23
  debug("Targeting node_modules/.bin/cmf-cli. Making sure path exists...");
25
- const dir = path.join(node_modules(), ".bin", "cmf-cli");
24
+ // __dirname is always <node_modules>/@criticalmanufacturing/cli, so two
25
+ // levels up is always the node_modules/ dir that owns .bin/ — whether this
26
+ // is a local install (with or without shrinkwrap) or a global install.
27
+ const dir = path.join(path.resolve(__dirname, '..', '..'), ".bin", "cmf-cli");
26
28
  await mkdirp(dir);
27
29
  debug(`Install path exists!`);
28
30
  return dir;
package/run.js CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  const { spawn } = require('child_process');
6
6
  const path = require('path');
7
- const node_modules = require('node_modules-path');
8
7
  const dbg = require('debug');
9
8
  const { parsePackageJson } = require('./utils');
10
9
 
@@ -13,7 +12,9 @@ const debug = dbg("cmf:debug");
13
12
 
14
13
  debug("Executing cmf-cli");
15
14
  debug("Getting binary from node_modules/.bin/cmf-cli...");
16
- const exePath = path.join(node_modules(), ".bin", "cmf-cli", opts.binName);
15
+ // __dirname is always <node_modules>/@criticalmanufacturing/cli, so two levels
16
+ // up is the node_modules/ that owns .bin/ — correct for local and global installs.
17
+ const exePath = path.join(path.resolve(__dirname, '..', '..'), ".bin", "cmf-cli", opts.binName);
17
18
  debug("Obtained binary path: " + exePath);
18
19
 
19
20
  debug(`Spawning cmf-cli from ${exePath} with args ${process.argv.slice(2)} and piping.`);