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

448: Correct value for FORCE_COLOR env var #451

Merged
merged 1 commit into from
May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const debug = require('debug')('lint-staged')
// but do this only in TTY mode
if (process.stdout.isTTY) {
// istanbul ignore next
process.env.FORCE_COLOR = true
process.env.FORCE_COLOR = '1'
}

const errConfigNotFound = new Error('Config could not be found')
Expand Down Expand Up @@ -53,15 +53,15 @@ module.exports = function lintStaged(logger = console, configPath, debugMode) {
.then(() => {
debug('linters were executed successfully!')
// No errors, exiting with 0
process.exitCode = 0
})
.catch(error => {
// Errors detected, printing and exiting with non-zero
printErrors(error)
process.exitCode = 1
printErrors(error)
})
})
.catch(err => {
process.exitCode = 1
if (err === errConfigNotFound) {
logger.error(`${err.message}.`)
} else {
Expand All @@ -78,6 +78,5 @@ module.exports = function lintStaged(logger = console, configPath, debugMode) {
Please make sure you have created it correctly.
See https://github.com/okonet/lint-staged#configuration.
`)
process.exitCode = 1
})
}