File tree Expand file tree Collapse file tree 5 files changed +15
-12
lines changed
node_modules/@npmcli/run-script Expand file tree Collapse file tree 5 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,13 @@ const sh = (input) => {
65
65
return result
66
66
}
67
67
68
+ // disabling the no-control-regex rule for this line as we very specifically _do_ want to
69
+ // replace those characters if they somehow exist at this point, which is highly unlikely
70
+ // eslint-disable-next-line no-control-regex
71
+ const filename = ( input ) => input . replace ( / [ < > : " / \\ | ? * \x00 - \x31 ] / g, '' )
72
+
68
73
module . exports = {
69
74
cmd,
70
75
sh,
76
+ filename,
71
77
}
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const makeSpawnArgs = options => {
30
30
npm_config_node_gyp,
31
31
} )
32
32
33
+ const fileName = escape . filename ( `${ event } -${ Date . now ( ) } ` )
33
34
let scriptFile
34
35
let script = ''
35
36
@@ -61,7 +62,7 @@ const makeSpawnArgs = options => {
61
62
62
63
const doubleEscape = pathToInitial . endsWith ( '.cmd' ) || pathToInitial . endsWith ( '.bat' )
63
64
64
- scriptFile = resolve ( tmpdir ( ) , `${ event } - ${ Date . now ( ) } .cmd` )
65
+ scriptFile = resolve ( tmpdir ( ) , `${ fileName } .cmd` )
65
66
script += '@echo off\n'
66
67
script += cmd
67
68
if ( args . length ) {
@@ -71,7 +72,7 @@ const makeSpawnArgs = options => {
71
72
const shebang = isAbsolute ( scriptShell )
72
73
? `#!${ scriptShell } `
73
74
: `#!/usr/bin/env ${ scriptShell } `
74
- scriptFile = resolve ( tmpdir ( ) , `${ event } - ${ Date . now ( ) } .sh` )
75
+ scriptFile = resolve ( tmpdir ( ) , `${ fileName } .sh` )
75
76
script += `${ shebang } \n`
76
77
script += cmd
77
78
if ( args . length ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @npmcli/run-script" ,
3
- "version" : " 4.1.3 " ,
3
+ "version" : " 4.1.4 " ,
4
4
"description" : " Run a lifecycle script for a package (descendant of npm-lifecycle)" ,
5
5
"author" : " GitHub Inc." ,
6
6
"license" : " ISC" ,
17
17
"posttest" : " npm run lint" ,
18
18
"template-oss-apply" : " template-oss-apply --force"
19
19
},
20
- "tap" : {
21
- "check-coverage" : true ,
22
- "coverage-map" : " map.js"
23
- },
24
20
"devDependencies" : {
25
21
"@npmcli/eslint-config" : " ^3.0.1" ,
26
22
"@npmcli/template-oss" : " 3.5.0" ,
Original file line number Diff line number Diff line change 93
93
"@npmcli/fs" : " ^2.1.0" ,
94
94
"@npmcli/map-workspaces" : " ^2.0.3" ,
95
95
"@npmcli/package-json" : " ^2.0.0" ,
96
- "@npmcli/run-script" : " ^4.1.3 " ,
96
+ "@npmcli/run-script" : " ^4.1.4 " ,
97
97
"abbrev" : " ~1.1.1" ,
98
98
"archy" : " ~1.0.0" ,
99
99
"cacache" : " ^16.1.1" ,
1042
1042
}
1043
1043
},
1044
1044
"node_modules/@npmcli/run-script" : {
1045
- "version" : " 4.1.3 " ,
1046
- "resolved" : " https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.3 .tgz" ,
1047
- "integrity" : " sha512-xb47c2KMkn6ERw2AwPPGKIITbWoXOT1yDV5rU3SYeC1vksYOodbgN0pnOptIVnRgS2e9G8R7BVDVm8lWp92unQ ==" ,
1045
+ "version" : " 4.1.4 " ,
1046
+ "resolved" : " https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.4 .tgz" ,
1047
+ "integrity" : " sha512-1Qk/EsHBKc40XkN1dF79ztae+ua9jEjDupU0rQgO/k+94t7eFjXGN/baRvA00aEOJuTZ4VjwlC2u+XECImJi5w ==" ,
1048
1048
"inBundle" : true ,
1049
1049
"dependencies" : {
1050
1050
"@npmcli/node-gyp" : " ^2.0.0" ,
Original file line number Diff line number Diff line change 62
62
"@npmcli/fs" : " ^2.1.0" ,
63
63
"@npmcli/map-workspaces" : " ^2.0.3" ,
64
64
"@npmcli/package-json" : " ^2.0.0" ,
65
- "@npmcli/run-script" : " ^4.1.3 " ,
65
+ "@npmcli/run-script" : " ^4.1.4 " ,
66
66
"abbrev" : " ~1.1.1" ,
67
67
"archy" : " ~1.0.0" ,
68
68
"cacache" : " ^16.1.1" ,
You can’t perform that action at this time.
0 commit comments