Skip to content

Commit 312d2ed

Browse files
committed
testing changes
1 parent e9abde7 commit 312d2ed

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

packages/create-react-app/createReactApp.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const program = new commander.Command(packageJson.name)
7676
'use a non-standard version of react-scripts'
7777
)
7878
.option('--use-npm')
79+
.option('--no-bin-links')
7980
.allowUnknownOption()
8081
.on('--help', () => {
8182
console.log(` Only ${chalk.green('<project-directory>')} is required.`);
@@ -159,10 +160,11 @@ createApp(
159160
program.verbose,
160161
program.scriptsVersion,
161162
program.useNpm,
163+
program.binLinks,
162164
hiddenProgram.internalTestingTemplate
163165
);
164166

165-
function createApp(name, verbose, version, useNpm, template) {
167+
function createApp(name, verbose, version, useNpm, binLinks, template) {
166168
const root = path.resolve(name);
167169
const appName = path.basename(root);
168170

@@ -184,8 +186,9 @@ function createApp(name, verbose, version, useNpm, template) {
184186
path.join(root, 'package.json'),
185187
JSON.stringify(packageJson, null, 2) + os.EOL
186188
);
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);
189192
const originalDirectory = process.cwd();
190193
process.chdir(root);
191194
if (!useYarn && !checkThatNpmCanReadCwd()) {
@@ -218,7 +221,16 @@ function createApp(name, verbose, version, useNpm, template) {
218221
version = '[email protected]';
219222
}
220223
}
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+
);
222234
}
223235

224236
function isYarnAvailable() {
@@ -235,7 +247,7 @@ function shouldUseYarn(appDir) {
235247
return (mono.isYarnWs && mono.isAppIncluded) || isYarnAvailable();
236248
}
237249

238-
function install(root, useYarn, dependencies, verbose, isOnline) {
250+
function install(root, useYarn, dependencies, verbose, binLinks, isOnline) {
239251
return new Promise((resolve, reject) => {
240252
let command;
241253
let args;
@@ -275,6 +287,11 @@ function install(root, useYarn, dependencies, verbose, isOnline) {
275287
args.push('--verbose');
276288
}
277289

290+
if (binLinks === false) {
291+
console.log(`ya got links?: ${binLinks}`);
292+
args.push('--no-bin-links');
293+
}
294+
278295
const child = spawn(command, args, { stdio: 'inherit' });
279296
child.on('close', code => {
280297
if (code !== 0) {
@@ -293,6 +310,7 @@ function run(
293310
appName,
294311
version,
295312
verbose,
313+
binLinks,
296314
originalDirectory,
297315
template,
298316
useYarn
@@ -318,9 +336,14 @@ function run(
318336
);
319337
console.log();
320338

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);
324347
})
325348
.then(packageName => {
326349
checkNodeVersion(packageName);

0 commit comments

Comments
 (0)