Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-08-01 20:12:34 +0300
committernlf <nlf@github.com>2022-08-03 00:57:32 +0300
commitd0be9a2bb53e74b30e13751afd1f6924990c8422 (patch)
tree27fc27771766aa89c0fbc3d786b42a9f64ebbf59
parentcd6bafdfbbd7a054709c11850b58f7dbc26eb8da (diff)
deps: @npmcli/run-script@4.2.0
- add `binPaths` param
-rw-r--r--node_modules/@npmcli/run-script/lib/make-spawn-args.js7
-rw-r--r--node_modules/@npmcli/run-script/lib/run-script-pkg.js2
-rw-r--r--node_modules/@npmcli/run-script/lib/set-path.js12
-rw-r--r--node_modules/@npmcli/run-script/package.json2
-rw-r--r--package-lock.json10
-rw-r--r--package.json2
-rw-r--r--workspaces/libnpmexec/package.json2
7 files changed, 21 insertions, 16 deletions
diff --git a/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/node_modules/@npmcli/run-script/lib/make-spawn-args.js
index f2253d7cc..7725fd976 100644
--- a/node_modules/@npmcli/run-script/lib/make-spawn-args.js
+++ b/node_modules/@npmcli/run-script/lib/make-spawn-args.js
@@ -20,6 +20,7 @@ const makeSpawnArgs = options => {
event,
path,
scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh',
+ binPaths,
env = {},
stdio,
cmd,
@@ -27,7 +28,7 @@ const makeSpawnArgs = options => {
stdioString = false,
} = options
- const spawnEnv = setPATH(path, {
+ const spawnEnv = setPATH(path, binPaths, {
// we need to at least save the PATH environment var
...process.env,
...env,
@@ -100,7 +101,9 @@ const makeSpawnArgs = options => {
// delete the script, this is just a best effort
try {
unlink(scriptFile)
- } catch (err) {}
+ } catch (err) {
+ // ignore errors
+ }
}
return [scriptShell, spawnArgs, spawnOpts, cleanup]
diff --git a/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node_modules/@npmcli/run-script/lib/run-script-pkg.js
index 84c5e2bfe..ec6ef31e5 100644
--- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js
+++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js
@@ -14,6 +14,7 @@ const runScriptPkg = async options => {
event,
path,
scriptShell,
+ binPaths = false,
env = {},
stdio = 'pipe',
pkg,
@@ -58,6 +59,7 @@ const runScriptPkg = async options => {
event,
path,
scriptShell,
+ binPaths,
env: packageEnvs(env, pkg),
stdio,
cmd,
diff --git a/node_modules/@npmcli/run-script/lib/set-path.js b/node_modules/@npmcli/run-script/lib/set-path.js
index 07671f445..c59c270d9 100644
--- a/node_modules/@npmcli/run-script/lib/set-path.js
+++ b/node_modules/@npmcli/run-script/lib/set-path.js
@@ -1,5 +1,4 @@
-const { resolve, dirname } = require('path')
-const isWindows = require('./is-windows.js')
+const { resolve, dirname, delimiter } = require('path')
// the path here is relative, even though it does not need to be
// in order to make the posix tests pass in windows
const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin')
@@ -7,18 +6,19 @@ const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin')
// Windows typically calls its PATH environ 'Path', but this is not
// guaranteed, nor is it guaranteed to be the only one. Merge them
// all together in the order they appear in the object.
-const setPATH = (projectPath, env) => {
- // not require('path').delimiter, because we fake this for testing
- const delimiter = isWindows ? ';' : ':'
+const setPATH = (projectPath, binPaths, env) => {
const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p])
.map(p => env[p].split(delimiter))
.reduce((set, p) => set.concat(p.filter(concatted => !set.includes(concatted))), [])
.join(delimiter)
const pathArr = []
+ if (binPaths) {
+ pathArr.push(...binPaths)
+ }
// unshift the ./node_modules/.bin from every folder
// walk up until dirname() does nothing, at the root
- // XXX should we specify a cwd that we don't go above?
+ // XXX we should specify a cwd that we don't go above
let p = projectPath
let pp
do {
diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json
index c096f3942..a6629826d 100644
--- a/node_modules/@npmcli/run-script/package.json
+++ b/node_modules/@npmcli/run-script/package.json
@@ -1,6 +1,6 @@
{
"name": "@npmcli/run-script",
- "version": "4.1.7",
+ "version": "4.2.0",
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",
"author": "GitHub Inc.",
"license": "ISC",
diff --git a/package-lock.json b/package-lock.json
index 16e153b1d..4a952e2ff 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -94,7 +94,7 @@
"@npmcli/fs": "^2.1.0",
"@npmcli/map-workspaces": "^2.0.3",
"@npmcli/package-json": "^2.0.0",
- "@npmcli/run-script": "^4.1.7",
+ "@npmcli/run-script": "^4.2.0",
"abbrev": "~1.1.1",
"archy": "~1.0.0",
"cacache": "^16.1.1",
@@ -1057,9 +1057,9 @@
}
},
"node_modules/@npmcli/run-script": {
- "version": "4.1.7",
- "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.7.tgz",
- "integrity": "sha512-WXr/MyM4tpKA4BotB81NccGAv8B48lNH0gRoILucbcAhTQXLCoi6HflMV3KdXubIqvP9SuLsFn68Z7r4jl+ppw==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.0.tgz",
+ "integrity": "sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA==",
"inBundle": true,
"dependencies": {
"@npmcli/node-gyp": "^2.0.0",
@@ -10137,7 +10137,7 @@
"@npmcli/arborist": "^5.0.0",
"@npmcli/ci-detect": "^2.0.0",
"@npmcli/fs": "^2.1.1",
- "@npmcli/run-script": "^4.1.3",
+ "@npmcli/run-script": "^4.2.0",
"chalk": "^4.1.0",
"mkdirp-infer-owner": "^2.0.0",
"npm-package-arg": "^9.0.1",
diff --git a/package.json b/package.json
index 7526c4754..1adb37652 100644
--- a/package.json
+++ b/package.json
@@ -62,7 +62,7 @@
"@npmcli/fs": "^2.1.0",
"@npmcli/map-workspaces": "^2.0.3",
"@npmcli/package-json": "^2.0.0",
- "@npmcli/run-script": "^4.1.7",
+ "@npmcli/run-script": "^4.2.0",
"abbrev": "~1.1.1",
"archy": "~1.0.0",
"cacache": "^16.1.1",
diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json
index 58c546fc2..349e82715 100644
--- a/workspaces/libnpmexec/package.json
+++ b/workspaces/libnpmexec/package.json
@@ -58,7 +58,7 @@
"@npmcli/arborist": "^5.0.0",
"@npmcli/ci-detect": "^2.0.0",
"@npmcli/fs": "^2.1.1",
- "@npmcli/run-script": "^4.1.3",
+ "@npmcli/run-script": "^4.2.0",
"chalk": "^4.1.0",
"mkdirp-infer-owner": "^2.0.0",
"npm-package-arg": "^9.0.1",