Respect NO_COLOR environment variable when linting certs.

This commit is contained in:
Justus Winter 2024-01-17 13:17:38 +01:00
parent 5e949ed638
commit e2977a7a23
No known key found for this signature in database
GPG Key ID: 686F55B4AB2B3386

View File

@ -737,7 +737,7 @@ pub fn lint(config: Config, mut args: LintCommand) -> Result<()> {
eprint!(" (");
if $n > 0 {
if std::io::stderr().is_terminal() {
let mut stderr = StandardStream::stderr(ColorChoice::Always);
let mut stderr = StandardStream::stderr(ColorChoice::Auto);
stderr.set_color(ColorSpec::new().set_fg(Some(Color::Red)))?;
write!(&mut stderr, "BAD")?;
stderr.reset()?;
@ -746,7 +746,7 @@ pub fn lint(config: Config, mut args: LintCommand) -> Result<()> {
}
} else {
if std::io::stderr().is_terminal() {
let mut stderr = StandardStream::stderr(ColorChoice::Always);
let mut stderr = StandardStream::stderr(ColorChoice::Auto);
stderr.set_color(ColorSpec::new().set_fg(Some(Color::Green)))?;
write!(&mut stderr, "GOOD")?;
stderr.reset()?;