mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
This reverts commit 38f1630223
.
This commit is contained in:
parent
0dec9b4381
commit
aeadc29fcd
1 changed files with 1 additions and 4 deletions
|
@ -9,14 +9,11 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
|
|||
use termcolor::{BufferWriter, ColorChoice};
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
// checks if the output is piped to a tty
|
||||
static ref IS_TTY: bool = atty::is(atty::Stream::Stdout);
|
||||
static ref NO_COLOR: bool = std::env::var_os("NO_COLOR").is_some();
|
||||
}
|
||||
|
||||
// if the output is piped to a tty, use color
|
||||
pub fn use_color() -> bool {
|
||||
!(*NO_COLOR) && *IS_TTY
|
||||
!(*NO_COLOR)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
|
|
Loading…
Add table
Reference in a new issue