Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect check if CI variable is set to true #2501

Merged
merged 2 commits into from
Jun 19, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() === 'true' && messages.warnings.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling people might set this to things like travis, etc.

How about checking !== 'false'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about real practice of using this variable, I think we need some discussion first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the way it works currently (truthy), using !== false would retain current functionality and wouldn't be a breaking change (if you consider 'false' a bug).

Even if 'true' is the proper value to evaluate against, we would have to postpone that to 2.0.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I agree then.

console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
Expand Down