Skip to content

Commit

Permalink
refactor: remove double coerce (#7882)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmckeb authored and ianschmitz committed Oct 27, 2019
1 parent 324428f commit 971f249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ function run(
)
.then(({ isOnline, packageInfo, templateInfo }) => {
let packageVersion = semver.coerce(packageInfo.version);

// This environment variable can be removed post-release.
const templatesVersionMinimum = process.env.CRA_INTERNAL_TEST
? '3.2.0'
: '3.3.0';
Expand All @@ -454,7 +456,7 @@ function run(

// Only support templates when used alongside new react-scripts versions.
const supportsTemplates = semver.gte(
semver.coerce(packageVersion),
packageVersion,
templatesVersionMinimum
);
if (supportsTemplates) {
Expand Down

0 comments on commit 971f249

Please sign in to comment.