File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
packages/angular/cli/utilities Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,22 @@ import { existsSync } from 'fs';
10
10
import { join } from 'path' ;
11
11
import { getConfiguredPackageManager } from './config' ;
12
12
13
-
14
- export function supportsYarn ( ) : boolean {
13
+ function supports ( name : string ) : boolean {
15
14
try {
16
- execSync ( 'yarn --version' ) ;
15
+ execSync ( ` ${ name } --version` , { stdio : 'ignore' } ) ;
17
16
18
17
return true ;
19
18
} catch {
20
19
return false ;
21
20
}
22
21
}
23
22
24
- export function supportsNpm ( ) : boolean {
25
- try {
26
- execSync ( 'npm --version' ) ;
23
+ export function supportsYarn ( ) : boolean {
24
+ return supports ( 'yarn' ) ;
25
+ }
27
26
28
- return true ;
29
- } catch {
30
- return false ;
31
- }
27
+ export function supportsNpm ( ) : boolean {
28
+ return supports ( 'npm' ) ;
32
29
}
33
30
34
31
export function getPackageManager ( root : string ) : string {
You can’t perform that action at this time.
0 commit comments