Skip to content

Commit 2832f8d

Browse files
committed
Respect falsy values in the env var
1 parent 143d9d0 commit 2832f8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/output.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ fn create_cooldown_sentinel(path: PathBuf) -> Result<(), Error> {
145145
fn should_print_activation() -> bool {
146146
let configured_to_print: bool;
147147
match env::var("SHADOWENV_SILENT") {
148-
Ok(_) => configured_to_print = false,
148+
Ok(value) => match value.to_lowercase().as_str() {
149+
"0" | "false" | "no" | "" => configured_to_print = true,
150+
_ => configured_to_print = false,
151+
},
149152
Err(_) => configured_to_print = true,
150153
};
151154
return is(Stream::Stderr) && configured_to_print;

0 commit comments

Comments
 (0)