]> git.lizzy.rs Git - rust.git/commitdiff
also detect Azure CI environments
authorRalf Jung <post@ralfj.de>
Sun, 13 Sep 2020 19:10:29 +0000 (21:10 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 13 Sep 2020 19:10:29 +0000 (21:10 +0200)
cargo-miri/bin.rs

index 98304d247f98f98595bd6e8a4874f13b44f8e4b9..12c5d1c325539494765278a6927c346b15101447 100644 (file)
@@ -207,7 +207,10 @@ fn xargo_version() -> Option<(u32, u32, u32)> {
 
 fn ask_to_run(mut cmd: Command, ask: bool, text: &str) {
     // Disable interactive prompts in CI (GitHub Actions, Travis, AppVeyor, etc).
-    if ask && env::var_os("CI").is_none() {
+    // Azure doesn't set `CI` though (nothing to see here, just Microsoft being Microsoft),
+    // so we also check their `TF_BUILD`.
+    let is_ci = env::var_os("CI").is_some() || env::var_os("TF_BUILD").is_some();
+    if ask && !is_ci {
         let mut buf = String::new();
         print!("I will run `{:?}` to {}. Proceed? [Y/n] ", cmd, text);
         io::stdout().flush().unwrap();