summaryrefslogtreecommitdiff
path: root/cli/permissions.rs
diff options
context:
space:
mode:
authorJoão Souto <joao.jpgs@hotmail.com>2020-02-25 00:30:17 +0000
committerGitHub <noreply@github.com>2020-02-24 19:30:17 -0500
commit5c1ab080cd8989c3ac2b3a8c919fe14052feac79 (patch)
treec6c31ddaa8634f9d7793f662fcdeed9db7e1b437 /cli/permissions.rs
parentac933dd1b89a20b2e63b5d6edc5b3d0c549335bc (diff)
Remove ansi_term dependency (#4116)
Diffstat (limited to 'cli/permissions.rs')
-rw-r--r--cli/permissions.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/permissions.rs b/cli/permissions.rs
index a6d0210ea..a14a1b4f2 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!("{}", Style::new().bold().paint(msg));
+ eprint!("{}", colors::bold(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!("{}", Style::new().bold().paint(msg_again));
+ eprint!("{}", colors::bold(msg_again));
}
};
}
@@ -352,9 +352,7 @@ fn log_perm_access(message: &str) {
if log_enabled!(log::Level::Info) {
eprintln!(
"{}",
- Style::new()
- .bold()
- .paint(format!("{}️ Granted {}", PERMISSION_EMOJI, message))
+ colors::bold(format!("{}️ Granted {}", PERMISSION_EMOJI, message))
);
}
}