All files / src initial-setup.js

80% Statements 16/20
60% Branches 3/5
100% Functions 0/0
80% Lines 16/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21193x 193x 193x 193x     193x 193x 193x 193x     193x 193x 193x 193x 193x 191x 191x 191x  
import { hasParam } from './lib/has-param.js';
 
// These need to be set before Logger and other stuffs
if (hasParam('-v') || hasParam('--verbose')) {
  process.env.CLEVER_VERBOSE = '1';
}
 
// These need to be set before Logger and other stuffs
// Don't log anything in autocomplete mode
if (hasParam('--autocomplete-index')) {
  process.env.CLEVER_QUIET = '1';
}
 
// These need to be set before other stuffs
const colorExplicitFalse = hasParam('--no-color') || hasParam('--color', 'false');
const colorExplicitTrue = hasParam('--color', 'true');
if (colorExplicitFalse || (!process.stdout.isTTY && !colorExplicitTrue)) {
  process.env.NO_COLOR = '1';
  delete process.env.FORCE_COLOR;
}