File tree 5 files changed +20
-14
lines changed
node_modules/@npmcli/run-script
5 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ const runScriptPkg = async options => {
94
94
return p . catch ( er => {
95
95
const { signal } = er
96
96
if ( stdio === 'inherit' && signal ) {
97
+ // by the time we reach here, the child has already exited. we send the
98
+ // signal back to ourselves again so that npm will exit with the same
99
+ // status as the child
97
100
process . kill ( process . pid , signal )
101
+
98
102
// just in case we don't die, reject after 500ms
99
103
// this also keeps the node process open long enough to actually
100
104
// get the signal, rather than terminating gracefully.
Original file line number Diff line number Diff line change 1
1
const runningProcs = new Set ( )
2
2
let handlersInstalled = false
3
3
4
+ // NOTE: these signals aren't actually forwarded anywhere. they're trapped and
5
+ // ignored until all child processes have exited. in our next breaking change
6
+ // we should rename this
4
7
const forwardedSignals = [
5
8
'SIGINT' ,
6
9
'SIGTERM' ,
7
10
]
8
11
9
- const handleSignal = signal => {
10
- for ( const proc of runningProcs ) {
11
- proc . kill ( signal )
12
- }
13
- }
14
-
12
+ // no-op, this is so receiving the signal doesn't cause us to exit immediately
13
+ // instead, we exit after all children have exited when we re-send the signal
14
+ // to ourselves. see the catch handler at the bottom of run-script-pkg.js
15
+ // istanbul ignore next - this function does nothing
16
+ const handleSignal = ( ) => { }
15
17
const setupListeners = ( ) => {
16
18
for ( const signal of forwardedSignals ) {
17
19
process . on ( signal , handleSignal )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @npmcli/run-script" ,
3
- "version" : " 6.0.1 " ,
3
+ "version" : " 6.0.2 " ,
4
4
"description" : " Run a lifecycle script for a package (descendant of npm-lifecycle)" ,
5
5
"author" : " GitHub Inc." ,
6
6
"license" : " ISC" ,
16
16
},
17
17
"devDependencies" : {
18
18
"@npmcli/eslint-config" : " ^4.0.0" ,
19
- "@npmcli/template-oss" : " 4.14 .1" ,
19
+ "@npmcli/template-oss" : " 4.15 .1" ,
20
20
"require-inject" : " ^1.4.4" ,
21
21
"tap" : " ^16.0.1"
22
22
},
41
41
},
42
42
"templateOSS" : {
43
43
"//@npmcli/template-oss" : " This file is partially managed by @npmcli/template-oss. Edits may be overwritten." ,
44
- "version" : " 4.14 .1" ,
44
+ "version" : " 4.15 .1" ,
45
45
"publish" : " true"
46
46
},
47
47
"tap" : {
Original file line number Diff line number Diff line change 88
88
"@npmcli/config": "^6.1.6",
89
89
"@npmcli/map-workspaces": "^3.0.4",
90
90
"@npmcli/package-json": "^3.0.0",
91
- "@npmcli/run-script": "^6.0.1 ",
91
+ "@npmcli/run-script": "^6.0.2 ",
92
92
"abbrev": "^2.0.0",
93
93
"archy": "~1.0.0",
94
94
"cacache": "^17.1.0",
2346
2346
}
2347
2347
},
2348
2348
"node_modules/@npmcli/run-script": {
2349
- "version": "6.0.1 ",
2350
- "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.1 .tgz",
2351
- "integrity": "sha512-Yi04ZSold8jcbBJD/ahKMJSQCQifH8DAbMwkBvoLaTpGFxzHC3B/5ZyoVR69q/4xedz84tvi9DJOJjNe17h+LA ==",
2349
+ "version": "6.0.2 ",
2350
+ "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2 .tgz",
2351
+ "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA ==",
2352
2352
"inBundle": true,
2353
2353
"dependencies": {
2354
2354
"@npmcli/node-gyp": "^3.0.0",
Original file line number Diff line number Diff line change 57
57
"@npmcli/config" : " ^6.1.6" ,
58
58
"@npmcli/map-workspaces" : " ^3.0.4" ,
59
59
"@npmcli/package-json" : " ^3.0.0" ,
60
- "@npmcli/run-script" : " ^6.0.1 " ,
60
+ "@npmcli/run-script" : " ^6.0.2 " ,
61
61
"abbrev" : " ^2.0.0" ,
62
62
"archy" : " ~1.0.0" ,
63
63
"cacache" : " ^17.1.0" ,
You can’t perform that action at this time.
0 commit comments