Skip to content

Commit 78cfbef

Browse files
committed
Disable CC_ENABLE_DEBUG_OUTPUT if it is set to "0"
It isn't always possible to completely unset an environment variable, but it is pretty common that a value of "0" should be treated as disabled. Use that here for `CC_ENABLE_DEBUG_OUTPUT`.
1 parent 7e9730b commit 78cfbef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/command_helpers.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ impl CargoOutput {
4444
metadata: true,
4545
warnings: true,
4646
output: OutputKind::Forward,
47-
debug: std::env::var_os("CC_ENABLE_DEBUG_OUTPUT").is_some(),
47+
debug: match std::env::var_os("CC_ENABLE_DEBUG_OUTPUT") {
48+
Some(v) if v == "0" => false,
49+
Some(_) => true,
50+
None => false,
51+
},
4852
checked_dbg_var: Arc::new(AtomicBool::new(false)),
4953
}
5054
}

0 commit comments

Comments
 (0)