From f6f323c36aaa4405fa14415c0ee48ef29a30d3a5 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 5 Oct 2024 22:50:53 -0500 Subject: [PATCH] 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`. --- src/command_helpers.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command_helpers.rs b/src/command_helpers.rs index 07dfb804..0def5fea 100644 --- a/src/command_helpers.rs +++ b/src/command_helpers.rs @@ -44,7 +44,10 @@ impl CargoOutput { metadata: true, warnings: true, output: OutputKind::Forward, - debug: std::env::var_os("CC_ENABLE_DEBUG_OUTPUT").is_some(), + debug: match std::env::var_os("CC_ENABLE_DEBUG_OUTPUT") { + Some(v) => v != "0", + None => false, + }, checked_dbg_var: Arc::new(AtomicBool::new(false)), } }