Skip to content

Commit

Permalink
Only use yarn.lock.cached if using the default Yarn registry (#6253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meo H authored and gaearon committed Feb 18, 2019
1 parent 09def49 commit a8af55d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,21 @@ function createApp(
}

if (useYarn) {
fs.copySync(
require.resolve('./yarn.lock.cached'),
path.join(root, 'yarn.lock')
);
let yarnUsesDefaultRegistry = true;
try {
yarnUsesDefaultRegistry =
execSync('yarnpkg config get registry')
.toString()
.trim() === 'https://registry.yarnpkg.com';
} catch (e) {
// ignore
}
if (yarnUsesDefaultRegistry) {
fs.copySync(
require.resolve('./yarn.lock.cached'),
path.join(root, 'yarn.lock')
);
}
}

run(
Expand Down

0 comments on commit a8af55d

Please sign in to comment.