Move force_coloring_in_ci from builder_helper to bootstrap
It was only used in bootstrap. This move allows us to modify the function to work with `BootstrapCommand`, rather than `Command`.
This commit is contained in:
parent
8cffb475fd
commit
ff9c488344
4 changed files with 15 additions and 18 deletions
|
|
@ -1,5 +1,3 @@
|
|||
use std::process::Command;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub enum CiEnv {
|
||||
/// Not a CI environment.
|
||||
|
|
@ -21,18 +19,6 @@ impl CiEnv {
|
|||
pub fn is_ci() -> bool {
|
||||
Self::current() != CiEnv::None
|
||||
}
|
||||
|
||||
/// If in a CI environment, forces the command to run with colors.
|
||||
pub fn force_coloring_in_ci(self, cmd: &mut Command) {
|
||||
if self != CiEnv::None {
|
||||
// Due to use of stamp/docker, the output stream of bootstrap is not
|
||||
// a TTY in CI, so coloring is by-default turned off.
|
||||
// The explicit `TERM=xterm` environment is needed for
|
||||
// `--color always` to actually work. This env var was lost when
|
||||
// compiling through the Makefile. Very strange.
|
||||
cmd.env("TERM", "xterm").args(&["--color", "always"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod gha {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue