Skip to content

Commit

Permalink
Auto merge of #6281 - ehuss:ci-progress, r=alexcrichton
Browse files Browse the repository at this point in the history
Disable progress bar on CI.

Due to the recent change (#6233) to use ansi escape codes to clear the progress bar, Travis logs are looking quite odd. Generally you don't want the progress bar during CI builds anyways, so just disable it if "CI" is set, which most of the CI services do.
  • Loading branch information
bors committed Nov 8, 2018
2 parents 1f730be + f06a9e9 commit 1ffd248
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cargo/util/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ struct Format {
impl<'cfg> Progress<'cfg> {
pub fn with_style(name: &str, style: ProgressStyle, cfg: &'cfg Config) -> Progress<'cfg> {
// report no progress when -q (for quiet) or TERM=dumb are set
// or if running on Continuous Integration service like Travis where the
// output logs get mangled.
let dumb = match env::var("TERM") {
Ok(term) => term == "dumb",
Err(_) => false,
};
if cfg.shell().verbosity() == Verbosity::Quiet || dumb {
if cfg.shell().verbosity() == Verbosity::Quiet || dumb || env::var("CI").is_ok() {
return Progress { state: None };
}

Expand Down

0 comments on commit 1ffd248

Please sign in to comment.