diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-02-24 17:18:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 17:18:15 -0500 |
commit | 4005174f6c584fd5200dbe450b269a7f0de487ce (patch) | |
tree | 7cc3b463e81054f0f29219276ec64aeb5fd87d14 /cli/permissions.rs | |
parent | 79c6e052ed29b9b78c31f2e01da3b91f76b6a017 (diff) |
Revert "Remove ansi_term dependency"
Broke colors
https://github.com/denoland/deno/issues/4112#issuecomment-590545385
This reverts commit c250778704a4e0065e54e6bf6ca6c39d556a6d8d.
Diffstat (limited to 'cli/permissions.rs')
-rw-r--r-- | cli/permissions.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/permissions.rs b/cli/permissions.rs index a14a1b4f2..a6d0210ea 100644 --- a/cli/permissions.rs +++ b/cli/permissions.rs @@ -1,7 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -use crate::colors; use crate::flags::DenoFlags; use crate::op_error::OpError; +use ansi_term::Style; #[cfg(not(test))] use atty; use log; @@ -305,7 +305,7 @@ fn permission_prompt(message: &str) -> bool { PERMISSION_EMOJI, message ); // print to stderr so that if deno is > to a file this is still displayed. - eprint!("{}", colors::bold(msg)); + eprint!("{}", Style::new().bold().paint(msg)); loop { let mut input = String::new(); let stdin = io::stdin(); @@ -321,7 +321,7 @@ fn permission_prompt(message: &str) -> bool { // If we don't get a recognized option try again. let msg_again = format!("Unrecognized option '{}' [g/d (g = grant, d = deny)] ", ch); - eprint!("{}", colors::bold(msg_again)); + eprint!("{}", Style::new().bold().paint(msg_again)); } }; } @@ -352,7 +352,9 @@ fn log_perm_access(message: &str) { if log_enabled!(log::Level::Info) { eprintln!( "{}", - colors::bold(format!("{}️ Granted {}", PERMISSION_EMOJI, message)) + Style::new() + .bold() + .paint(format!("{}️ Granted {}", PERMISSION_EMOJI, message)) ); } } |