@@ -76,6 +76,7 @@ const program = new commander.Command(packageJson.name)
76
76
'use a non-standard version of react-scripts'
77
77
)
78
78
. option ( '--use-npm' )
79
+ . option ( '--no-bin-links' )
79
80
. allowUnknownOption ( )
80
81
. on ( '--help' , ( ) => {
81
82
console . log ( ` Only ${ chalk . green ( '<project-directory>' ) } is required.` ) ;
@@ -159,10 +160,11 @@ createApp(
159
160
program . verbose ,
160
161
program . scriptsVersion ,
161
162
program . useNpm ,
163
+ program . binLinks ,
162
164
hiddenProgram . internalTestingTemplate
163
165
) ;
164
166
165
- function createApp ( name , verbose , version , useNpm , template ) {
167
+ function createApp ( name , verbose , version , useNpm , binLinks , template ) {
166
168
const root = path . resolve ( name ) ;
167
169
const appName = path . basename ( root ) ;
168
170
@@ -184,8 +186,9 @@ function createApp(name, verbose, version, useNpm, template) {
184
186
path . join ( root , 'package.json' ) ,
185
187
JSON . stringify ( packageJson , null , 2 ) + os . EOL
186
188
) ;
187
-
188
- const useYarn = useNpm ? false : shouldUseYarn ( root ) ;
189
+ console . log ( `what are we using?: ${ useNpm } ` ) ;
190
+ const useYarn = false ;
191
+ //const useYarn = useNpm ? false : shouldUseYarn(root);
189
192
const originalDirectory = process . cwd ( ) ;
190
193
process . chdir ( root ) ;
191
194
if ( ! useYarn && ! checkThatNpmCanReadCwd ( ) ) {
@@ -218,7 +221,16 @@ function createApp(name, verbose, version, useNpm, template) {
218
221
219
222
}
220
223
}
221
- run ( root , appName , version , verbose , originalDirectory , template , useYarn ) ;
224
+ run (
225
+ root ,
226
+ appName ,
227
+ version ,
228
+ verbose ,
229
+ binLinks ,
230
+ originalDirectory ,
231
+ template ,
232
+ useYarn
233
+ ) ;
222
234
}
223
235
224
236
function isYarnAvailable ( ) {
@@ -235,7 +247,7 @@ function shouldUseYarn(appDir) {
235
247
return ( mono . isYarnWs && mono . isAppIncluded ) || isYarnAvailable ( ) ;
236
248
}
237
249
238
- function install ( root , useYarn , dependencies , verbose , isOnline ) {
250
+ function install ( root , useYarn , dependencies , verbose , binLinks , isOnline ) {
239
251
return new Promise ( ( resolve , reject ) => {
240
252
let command ;
241
253
let args ;
@@ -275,6 +287,11 @@ function install(root, useYarn, dependencies, verbose, isOnline) {
275
287
args . push ( '--verbose' ) ;
276
288
}
277
289
290
+ if ( binLinks === false ) {
291
+ console . log ( `ya got links?: ${ binLinks } ` ) ;
292
+ args . push ( '--no-bin-links' ) ;
293
+ }
294
+
278
295
const child = spawn ( command , args , { stdio : 'inherit' } ) ;
279
296
child . on ( 'close' , code => {
280
297
if ( code !== 0 ) {
@@ -293,6 +310,7 @@ function run(
293
310
appName ,
294
311
version ,
295
312
verbose ,
313
+ binLinks ,
296
314
originalDirectory ,
297
315
template ,
298
316
useYarn
@@ -318,9 +336,14 @@ function run(
318
336
) ;
319
337
console . log ( ) ;
320
338
321
- return install ( root , useYarn , allDependencies , verbose , isOnline ) . then (
322
- ( ) => packageName
323
- ) ;
339
+ return install (
340
+ root ,
341
+ useYarn ,
342
+ allDependencies ,
343
+ verbose ,
344
+ binLinks ,
345
+ isOnline
346
+ ) . then ( ( ) => packageName ) ;
324
347
} )
325
348
. then ( packageName => {
326
349
checkNodeVersion ( packageName ) ;
0 commit comments