+38
-23
lines changedFilter options
+38
-23
lines changed Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
1
1
/* eslint camelcase: "off" */
2
2
const setPATH = require('./set-path.js')
3
3
const { resolve } = require('path')
4
-
const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
4
+
5
+
let npm_config_node_gyp
5
6
6
7
const makeSpawnArgs = options => {
7
8
const {
9
+
args,
10
+
binPaths,
11
+
cmd,
12
+
env,
8
13
event,
14
+
nodeGyp,
9
15
path,
10
16
scriptShell = true,
11
-
binPaths,
12
-
env,
13
17
stdio,
14
-
cmd,
15
-
args,
16
18
stdioString,
17
19
} = options
18
20
21
+
if (nodeGyp) {
22
+
// npm already pulled this from env and passes it in to options
23
+
npm_config_node_gyp = nodeGyp
24
+
} else if (env.npm_config_node_gyp) {
25
+
// legacy mode for standalone user
26
+
npm_config_node_gyp = env.npm_config_node_gyp
27
+
} else {
28
+
// default
29
+
npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
30
+
}
31
+
19
32
const spawnEnv = setPATH(path, binPaths, {
20
33
// we need to at least save the PATH environment var
21
34
...process.env,
Original file line number Diff line number Diff line change
@@ -7,18 +7,19 @@ const isServerPackage = require('./is-server-package.js')
7
7
8
8
const runScriptPkg = async options => {
9
9
const {
10
-
event,
11
-
path,
12
-
scriptShell,
10
+
args = [],
13
11
binPaths = false,
14
12
env = {},
15
-
stdio = 'pipe',
13
+
event,
14
+
nodeGyp,
15
+
path,
16
16
pkg,
17
-
args = [],
18
-
stdioString,
17
+
scriptShell,
19
18
// how long to wait for a process.kill signal
20
19
// only exposed here so that we can make the test go a bit faster.
21
20
signalTimeout = 500,
21
+
stdio = 'pipe',
22
+
stdioString,
22
23
} = options
23
24
24
25
const { scripts = {}, gypfile } = pkg
@@ -63,14 +64,15 @@ const runScriptPkg = async options => {
63
64
}
64
65
65
66
const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({
67
+
args,
68
+
binPaths,
69
+
cmd,
70
+
env: { ...env, ...packageEnvs(pkg) },
66
71
event,
72
+
nodeGyp,
67
73
path,
68
74
scriptShell,
69
-
binPaths,
70
-
env: { ...env, ...packageEnvs(pkg) },
71
75
stdio,
72
-
cmd,
73
-
args,
74
76
stdioString,
75
77
})
76
78
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@npmcli/run-script",
3
-
"version": "9.0.2",
3
+
"version": "9.1.0",
4
4
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",
5
5
"author": "GitHub Inc.",
6
6
"license": "ISC",
@@ -16,7 +16,7 @@
16
16
},
17
17
"devDependencies": {
18
18
"@npmcli/eslint-config": "^5.0.0",
19
-
"@npmcli/template-oss": "4.23.4",
19
+
"@npmcli/template-oss": "4.24.1",
20
20
"spawk": "^1.8.1",
21
21
"tap": "^16.0.1"
22
22
},
@@ -42,7 +42,7 @@
42
42
},
43
43
"templateOSS": {
44
44
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
45
-
"version": "4.23.4",
45
+
"version": "4.24.1",
46
46
"publish": "true"
47
47
},
48
48
"tap": {
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@
92
92
"@npmcli/package-json": "^6.1.1",
93
93
"@npmcli/promise-spawn": "^8.0.2",
94
94
"@npmcli/redact": "^3.1.1",
95
-
"@npmcli/run-script": "^9.0.1",
95
+
"@npmcli/run-script": "^9.1.0",
96
96
"@sigstore/tuf": "^3.0.0",
97
97
"abbrev": "^3.0.0",
98
98
"archy": "~1.0.0",
@@ -3726,9 +3726,9 @@
3726
3726
}
3727
3727
},
3728
3728
"node_modules/@npmcli/run-script": {
3729
-
"version": "9.0.2",
3730
-
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.0.2.tgz",
3731
-
"integrity": "sha512-cJXiUlycdizQwvqE1iaAb4VRUM3RX09/8q46zjvy+ct9GhfZRWd7jXYVc1tn/CfRlGPVkX/u4sstRlepsm7hfw==",
3729
+
"version": "9.1.0",
3730
+
"resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.1.0.tgz",
3731
+
"integrity": "sha512-aoNSbxtkePXUlbZB+anS1LqsJdctG5n3UVhfU47+CDdwMi6uNTBMF9gPcQRnqghQd2FGzcwwIFBruFMxjhBewg==",
3732
3732
"inBundle": true,
3733
3733
"license": "ISC",
3734
3734
"dependencies": {
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@
59
59
"@npmcli/package-json": "^6.1.1",
60
60
"@npmcli/promise-spawn": "^8.0.2",
61
61
"@npmcli/redact": "^3.1.1",
62
-
"@npmcli/run-script": "^9.0.1",
62
+
"@npmcli/run-script": "^9.1.0",
63
63
"@sigstore/tuf": "^3.0.0",
64
64
"abbrev": "^3.0.0",
65
65
"archy": "~1.0.0",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4