File tree Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,20 @@ export default async function shadowBin(
2424 path . join ( constants . distPath , 'npm-injection.js' ) ,
2525 // Lazily access constants.shadowBinPath.
2626 await installLinks ( constants . shadowBinPath , binName ) ,
27- ...binArgs ,
28- // Add the `--quiet` and `--no-progress` flags to fix input being swallowed
29- // by the spinner when running the command with recent versions of npm.
30- ...( binName === NPM &&
31- binArgs . includes ( 'install' ) &&
32- ! binArgs . includes ( '--no-progress' ) &&
33- ! binArgs . includes ( '--quiet' )
34- ? [ '--no-progress' , '--quiet' ]
35- : [ ] )
27+ ...( binName === NPM && binArgs . includes ( 'install' )
28+ ? [
29+ // Add the `--quiet` and `--no-progress` flags to fix input being swallowed
30+ // by the spinner when running the command with recent versions of npm.
31+ ...binArgs . filter ( a => a !== '--progress' && a !== '--no-progress' ) ,
32+ '--no-progress' ,
33+ ...( binArgs . includes ( '-q' ) ||
34+ binArgs . includes ( '--quiet' ) ||
35+ binArgs . includes ( '-s' ) ||
36+ binArgs . includes ( '--silent' )
37+ ? [ ]
38+ : [ '--quiet' ] )
39+ ]
40+ : binArgs )
3641 ] ,
3742 {
3843 signal : abortSignal ,
Original file line number Diff line number Diff line change @@ -19,7 +19,20 @@ type ShadowNpmInstallOptions = SpawnOption & {
1919}
2020
2121export function shadowNpmInstall ( opts ?: ShadowNpmInstallOptions ) {
22- const { flags = [ ] , ipc, ...spawnOptions } = { __proto__ : null , ...opts }
22+ const {
23+ flags : flags_ = [ ] ,
24+ ipc,
25+ ...spawnOptions
26+ } = { __proto__ : null , ...opts }
27+ const flags = flags_ . filter (
28+ f =>
29+ f !== '--audit' &&
30+ f !== '--fund' &&
31+ f !== '--progress' &&
32+ f !== '--no-audit' &&
33+ f !== '--no-fund' &&
34+ f !== '--no-progress'
35+ )
2336 const useIpc = isObject ( ipc )
2437 const useDebug = isDebug ( )
2538 const spawnPromise = spawn (
@@ -55,15 +68,7 @@ export function shadowNpmInstall(opts?: ShadowNpmInstallOptions) {
5568 )
5669 ? [ ]
5770 : [ '--silent' ] ) ,
58- ...flags . filter (
59- f =>
60- f !== '--audit' &&
61- f !== '--fund' &&
62- f !== '--progress' &&
63- f !== '--no-audit' &&
64- f !== '--no-fund' &&
65- f !== '--no-progress'
66- )
71+ ...flags
6772 ] ,
6873 {
6974 signal : abortSignal ,
You can’t perform that action at this time.
0 commit comments