Skip to content

Commit cdbeef6

Browse files
authored
fix(): use an environment variable to force colors instead of using the --colors flag. (#1557)
1 parent 5ee6657 commit cdbeef6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,12 @@ Cli.runWithNpmScripts = function runWithNpmScripts(argv, taskInstance, rawCliArg
316316

317317
Cli.runNpmHook = function runNpmHook(hook) {
318318
var cmd = 'npm';
319-
var args = ['run', hook, '--color'];
319+
var args = ['run', hook];
320320
var command = cmd + ' ' + args;
321321

322+
// Force colors for all spawned child processes
323+
process.env['FORCE_COLOR'] = true;
324+
322325
var q = Q.defer();
323326
var spawn = require('cross-spawn-async');
324327

0 commit comments

Comments
 (0)