Simplified NO_COLOR check
This commit is contained in:
parent
4a3e59159e
commit
e39414e571
@ -25,9 +25,7 @@ static std::ostream& rgb(std::ostream& out, int r, int g, int b, int code) {
|
||||
}
|
||||
|
||||
bool sc::io::should_color(const std::ostream& out) {
|
||||
char* no_color_env {getenv("NO_COLOR")};
|
||||
std::string no_color {no_color_env ? no_color_env : ""};
|
||||
return no_color != "1" && isatty_ostream(out);
|
||||
return !getenv("NO_COLOR") && isatty_ostream(out);
|
||||
}
|
||||
|
||||
bool sc::io::isatty_ostream(const std::ostream& out) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user