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(
24
24
path . join ( constants . distPath , 'npm-injection.js' ) ,
25
25
// Lazily access constants.shadowBinPath.
26
26
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 )
36
41
] ,
37
42
{
38
43
signal : abortSignal ,
Original file line number Diff line number Diff line change @@ -19,7 +19,20 @@ type ShadowNpmInstallOptions = SpawnOption & {
19
19
}
20
20
21
21
export 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
+ )
23
36
const useIpc = isObject ( ipc )
24
37
const useDebug = isDebug ( )
25
38
const spawnPromise = spawn (
@@ -55,15 +68,7 @@ export function shadowNpmInstall(opts?: ShadowNpmInstallOptions) {
55
68
)
56
69
? [ ]
57
70
: [ '--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
67
72
] ,
68
73
{
69
74
signal : abortSignal ,
You can’t perform that action at this time.
0 commit comments