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';
1010import { join } from 'path' ;
1111import { getConfiguredPackageManager } from './config' ;
1212
13-
14- export function supportsYarn ( ) : boolean {
13+ function supports ( name : string ) : boolean {
1514 try {
16- execSync ( 'yarn --version' ) ;
15+ execSync ( ` ${ name } --version` , { stdio : 'ignore' } ) ;
1716
1817 return true ;
1918 } catch {
2019 return false ;
2120 }
2221}
2322
24- export function supportsNpm ( ) : boolean {
25- try {
26- execSync ( 'npm --version' ) ;
23+ export function supportsYarn ( ) : boolean {
24+ return supports ( 'yarn' ) ;
25+ }
2726
28- return true ;
29- } catch {
30- return false ;
31- }
27+ export function supportsNpm ( ) : boolean {
28+ return supports ( 'npm' ) ;
3229}
3330
3431export function getPackageManager ( root : string ) : string {
You can’t perform that action at this time.
0 commit comments