Skip to content

Commit

Permalink
Merge cf59b65 into 6deedd0
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfelBgh committed Mar 7, 2018
2 parents 6deedd0 + cf59b65 commit a31d973
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/convict.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,14 @@ let convict = function convict(def) {
let output_err_bufs = [types_err_buf, missing_err_buf];

if (options.allowed === ALLOWED_OPTION_WARN && params_err_buf.length) {
global.console.log('Warning: '+ params_err_buf);
let warning = 'Warning:';
if (process.stdout.isTTY) {
// Write 'Warning:' in bold and in yellow
const SET_BOLD_YELLOW_TEXT = '\x1b[33;1m';
const RESET_ALL_ATTRIBUTES = '\x1b[0m';
warning = SET_BOLD_YELLOW_TEXT + warning + RESET_ALL_ATTRIBUTES;
}
global.console.log(warning + ' ' + params_err_buf);
} else if (options.allowed === ALLOWED_OPTION_STRICT) {
output_err_bufs.push(params_err_buf);
}
Expand Down

0 comments on commit a31d973

Please sign in to comment.