libnpmexec 5.0.3 → 5.0.4
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/lib/index.js +6 -4
- package/lib/run-script.js +3 -5
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const { mkdir } = require('fs/promises')
|
|
|
4
4
|
const { promisify } = require('util')
|
|
5
5
|
|
|
6
6
|
const Arborist = require('@npmcli/arborist')
|
|
7
|
-
const
|
|
7
|
+
const ciInfo = require('ci-info')
|
|
8
8
|
const crypto = require('crypto')
|
|
9
9
|
const log = require('proc-log')
|
|
10
10
|
const npa = require('npm-package-arg')
|
|
@@ -110,7 +110,7 @@ const exec = async (opts) => {
|
|
|
110
110
|
return run()
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
let needPackageCommandSwap = (args.length > 0) && (packages.length === 0)
|
|
114
114
|
// If they asked for a command w/o specifying a package, see if there is a
|
|
115
115
|
// bin that directly matches that name:
|
|
116
116
|
// - in the local package itself
|
|
@@ -126,9 +126,11 @@ const exec = async (opts) => {
|
|
|
126
126
|
if (localManifest?.bin?.[args[0]]) {
|
|
127
127
|
// we have to install the local package into the npx cache so that its
|
|
128
128
|
// bin links get set up
|
|
129
|
+
flatOptions.installLinks = false
|
|
130
|
+
// args[0] will exist when the package is installed
|
|
129
131
|
packages.push(path)
|
|
130
132
|
yes = true
|
|
131
|
-
|
|
133
|
+
needPackageCommandSwap = false
|
|
132
134
|
} else {
|
|
133
135
|
const dir = dirname(dirname(localBin))
|
|
134
136
|
const localBinPath = await localFileExists(dir, args[0], '/')
|
|
@@ -242,7 +244,7 @@ const exec = async (opts) => {
|
|
|
242
244
|
throw new Error('canceled')
|
|
243
245
|
}
|
|
244
246
|
|
|
245
|
-
if (noTTY() ||
|
|
247
|
+
if (noTTY() || ciInfo.isCI) {
|
|
246
248
|
log.warn('exec', `The following package${
|
|
247
249
|
add.length === 1 ? ' was' : 's were'
|
|
248
250
|
} not found and will be installed: ${
|
package/lib/run-script.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const chalk = require('chalk')
|
|
2
|
-
const
|
|
2
|
+
const ciInfo = require('ci-info')
|
|
3
3
|
const runScript = require('@npmcli/run-script')
|
|
4
4
|
const readPackageJson = require('read-package-json-fast')
|
|
5
5
|
const npmlog = require('npmlog')
|
|
@@ -44,10 +44,8 @@ const run = async ({
|
|
|
44
44
|
|
|
45
45
|
try {
|
|
46
46
|
if (script === scriptShell) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (isTTY) {
|
|
50
|
-
if (ciDetect()) {
|
|
47
|
+
if (!noTTY()) {
|
|
48
|
+
if (ciInfo.isCI) {
|
|
51
49
|
return log.warn('exec', 'Interactive mode disabled in CI environment')
|
|
52
50
|
}
|
|
53
51
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libnpmexec",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"bin/",
|
|
6
6
|
"lib/"
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@npmcli/eslint-config": "^4.0.0",
|
|
54
|
-
"@npmcli/template-oss": "4.
|
|
54
|
+
"@npmcli/template-oss": "4.10.0",
|
|
55
55
|
"bin-links": "^4.0.1",
|
|
56
56
|
"minify-registry-metadata": "^2.2.0",
|
|
57
57
|
"mkdirp": "^1.0.4",
|
|
58
58
|
"tap": "^16.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@npmcli/arborist": "^6.1.
|
|
62
|
-
"@npmcli/ci-detect": "^3.0.1",
|
|
61
|
+
"@npmcli/arborist": "^6.1.3",
|
|
63
62
|
"@npmcli/run-script": "^6.0.0",
|
|
64
63
|
"chalk": "^4.1.0",
|
|
64
|
+
"ci-info": "^3.6.1",
|
|
65
65
|
"npm-package-arg": "^10.0.0",
|
|
66
66
|
"npmlog": "^7.0.1",
|
|
67
67
|
"pacote": "^15.0.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"templateOSS": {
|
|
75
75
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
76
|
-
"version": "4.
|
|
76
|
+
"version": "4.10.0",
|
|
77
77
|
"content": "../../scripts/template-oss/index.js"
|
|
78
78
|
}
|
|
79
79
|
}
|