Fix red background issue with buck project output.
Summary:
Pretty straightforward. The intellij.py command was run with a console with
ansi enabled, which meant the output was wrapped in bash color codes which
were passed down to the main buck command console's stdout.
Test Plan: run buck project, no more blood bath.
diff --git a/src/com/facebook/buck/command/Project.java b/src/com/facebook/buck/command/Project.java
index f7abbab..fb6544c 100644
--- a/src/com/facebook/buck/command/Project.java
+++ b/src/com/facebook/buck/command/Project.java
@@ -42,7 +42,9 @@
import com.facebook.buck.shell.ShellStep;
import com.facebook.buck.step.ExecutionContext;
import com.facebook.buck.util.AndroidPlatformTarget;
+import com.facebook.buck.util.Ansi;
import com.facebook.buck.util.BuckConstant;
+import com.facebook.buck.util.Console;
import com.facebook.buck.util.HumanReadableException;
import com.facebook.buck.util.KeystoreProperties;
import com.facebook.buck.util.Paths;
@@ -939,7 +941,17 @@
}
};
- int exitCode = command.execute(executionContext);
+ Console console = executionContext.getConsole();
+ Console childConsole = new Console(
+ console.getVerbosity(),
+ console.getStdOut(),
+ console.getStdErr(),
+ Ansi.withoutTty());
+ ExecutionContext childContext = ExecutionContext.builder()
+ .setExecutionContext(executionContext)
+ .setConsole(childConsole)
+ .build();
+ int exitCode = command.execute(childContext);
return new ExitCodeAndStdOut(exitCode, command.getStdout());
}