From 1f4db46b9eaeb0d93157591d0eff4797cb019a36 Mon Sep 17 00:00:00 2001 From: varnav Date: Mon, 19 Jun 2017 19:36:28 +0300 Subject: [PATCH] Check if CI variable is set to `'false'` (#2501) * Fix incorrect check if CI variable is set to true Originally build would fail on warnings with any value of CI environment variable. Now it will correctly check if it's true. Discussed here: https://github.com/facebookincubator/create-react-app/issues/2453 * Check for "not false" instead of "not true" After discussion we decided that this will be closer to current functionality and not break anything. --- packages/react-scripts/scripts/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js index a83d287de..aa95774f5 100644 --- a/packages/react-scripts/scripts/build.js +++ b/packages/react-scripts/scripts/build.js @@ -112,7 +112,7 @@ function build(previousFileSizes) { if (messages.errors.length) { return reject(new Error(messages.errors.join('\n\n'))); } - if (process.env.CI && messages.warnings.length) { + if (process.env.CI && process.env.CI.toLowerCase() !== 'false' && messages.warnings.length) { console.log( chalk.yellow( '\nTreating warnings as errors because process.env.CI = true.\n' +