Skip to content

Commit

Permalink
fix(query)!: Update CLICOLOR_FORCE to check non-empty
Browse files Browse the repository at this point in the history
CLICOLOR_FORCE was changed in jhasse/clicolors#12 then jhasse/clicolors#20
  • Loading branch information
epage committed Jun 4, 2024
1 parent b64de77 commit 1d210c7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/anstyle-query/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ pub fn clicolor() -> Option<bool> {
/// [CLICOLOR_FORCE]: https://bixense.com/clicolors/
#[inline]
pub fn clicolor_force() -> bool {
let value = std::env::var_os("CLICOLOR_FORCE");
value
.as_deref()
.unwrap_or_else(|| std::ffi::OsStr::new("0"))
!= "0"
non_empty(std::env::var_os("CLICOLOR_FORCE").as_deref())
}

/// Check [NO_COLOR] status
Expand Down

0 comments on commit 1d210c7

Please sign in to comment.