From 2b96b9411cc6adc4b5c5a32014d4dc32d45cd0df Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Tue, 18 Oct 2016 09:33:23 -0500 Subject: [PATCH] fix(): use an environment variable to force colors instead of using the --colors flag. --- lib/cli.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 83a173e863..93d97c3241 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -316,9 +316,12 @@ Cli.runWithNpmScripts = function runWithNpmScripts(argv, taskInstance, rawCliArg Cli.runNpmHook = function runNpmHook(hook) { var cmd = 'npm'; - var args = ['run', hook, '--color']; + var args = ['run', hook]; var command = cmd + ' ' + args; + // Force colors for all spawned child processes + process.env['FORCE_COLOR'] = true; + var q = Q.defer(); var spawn = require('cross-spawn-async');