@@ -55,24 +55,24 @@ function userHasYarn() {
55
55
}
56
56
57
57
// This decides the 'interface' of the package managing command.
58
- // Ex: If it guesses the type of package manager as 'yarn',
58
+ // Ex: If it guesses the type of package manager as 'yarn',
59
59
// then it executes '(yarn) add' command instead of '(npm) install'.
60
60
function packageManagerType ( ) {
61
61
const defaultType = 'npm' ;
62
62
const supportedTypes = [ 'yarn' , 'npm' ] ;
63
63
64
64
if ( packageManager ) {
65
65
let t = supportedTypes . find ( type => {
66
- return ( packageManager . indexOf ( type ) > - 1 ) ;
67
- } )
66
+ return packageManager . indexOf ( type ) > - 1 ;
67
+ } ) ;
68
68
return t ? t : defaultType ;
69
69
}
70
70
71
71
return userHasYarn ( ) ? 'yarn' : defaultType ;
72
72
}
73
73
74
74
function packageManagerCmd ( ) {
75
- if ( packageManager ) {
75
+ if ( packageManager ) {
76
76
return packageManager ;
77
77
} else {
78
78
return packageManagerType ( ) === 'yarn' ? 'yarnpkg' : 'npm' ;
@@ -105,7 +105,9 @@ async function createApp(name: string, verbose: boolean, version: ?string): Prom
105
105
await fse . writeFile ( path . join ( root , 'package.json' ) , JSON . stringify ( packageJson , null , 2 ) ) ;
106
106
process . chdir ( root ) ;
107
107
108
- console . log ( `Using package manager as ${ packageManagerCmd ( ) } with ${ packageManagerType ( ) } interface.` )
108
+ console . log (
109
+ `Using package manager as ${ packageManagerCmd ( ) } with ${ packageManagerType ( ) } interface.`
110
+ ) ;
109
111
console . log ( 'Installing packages. This might take a couple minutes.' ) ;
110
112
console . log ( 'Installing react-native-scripts...' ) ;
111
113
console . log ( ) ;
@@ -122,7 +124,7 @@ function install(
122
124
let args , result ;
123
125
let cmd = packageManagerCmd ( ) ;
124
126
125
- if ( type === 'yarn' ) {
127
+ if ( type === 'yarn' ) {
126
128
args = [ 'add' ] ;
127
129
128
130
if ( verbose ) {
0 commit comments