aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
diff options
context:
space:
mode:
authorGravatar Shreya Bhattarai <shreyax@google.com>2015-08-03 20:33:30 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-04 09:09:25 +0000
commitcd03ca221c4686473d44315e9b448b8c001bb998 (patch)
tree8a7bfad1dc3de7cb24a110cde08695b5e2c976a6 /src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
parent2f55dd889dab524e57d1788abe529f6d51899000 (diff)
Fixed bug where blaze run with the --color=no flag was still printing out in color when the build fails.
Includes fix for problems causing the original slowdown to blaze query -- MOS_MIGRATED_REVID=99755414
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
index 715ef0e385..16ed00abe9 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
@@ -305,6 +305,10 @@ public class RunCommand implements BlazeCommand {
.addArgs(cmdLine).setEnv(runtime.getClientEnv()).setWorkingDir(workingDir).build();
try {
+ // Restore a raw EventHandler if it is registered. This allows for blaze run to produce the
+ // actual output of the command being run even if --color=no is specified.
+ runtime.getReporter().switchToAnsiAllowingHandler();
+
// The command API is a little strange in that the following statement
// will return normally only if the program exits with exit code 0.
// If it ends with any other code, we have to catch BadExitStatusException.