Skip to content

Commit ebc3b71

Browse files
committed
also detect Azure CI environments
1 parent 2249c10 commit ebc3b71

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cargo-miri/bin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ fn xargo_version() -> Option<(u32, u32, u32)> {
207207

208208
fn ask_to_run(mut cmd: Command, ask: bool, text: &str) {
209209
// Disable interactive prompts in CI (GitHub Actions, Travis, AppVeyor, etc).
210-
if ask && env::var_os("CI").is_none() {
210+
// Azure doesn't set `CI` though (nothing to see here, just Microsoft being Microsoft),
211+
// so we also check their `TF_BUILD`.
212+
let is_ci = env::var_os("CI").is_some() || env::var_os("TF_BUILD").is_some();
213+
if ask && !is_ci {
211214
let mut buf = String::new();
212215
print!("I will run `{:?}` to {}. Proceed? [Y/n] ", cmd, text);
213216
io::stdout().flush().unwrap();

0 commit comments

Comments
 (0)