mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
fix(cli): do not log update checker when log level is quiet (#16433)
Co-authored-by: lucacasonato <hello@lcas.dev>
This commit is contained in:
parent
37340e2386
commit
65f12f571b
1 changed files with 15 additions and 8 deletions
|
@ -164,15 +164,22 @@ pub fn check_for_upgrades(cache_dir: PathBuf) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print a message if an update is available, unless:
|
// Print a message if an update is available
|
||||||
// * stderr is not a tty
|
|
||||||
// * we're already running the 'deno upgrade' command.
|
|
||||||
if let Some(upgrade_version) = update_checker.should_prompt() {
|
if let Some(upgrade_version) = update_checker.should_prompt() {
|
||||||
if atty::is(atty::Stream::Stderr) {
|
if log::log_enabled!(log::Level::Info) && atty::is(atty::Stream::Stderr) {
|
||||||
|
if version::is_canary() {
|
||||||
eprint!(
|
eprint!(
|
||||||
"{} ",
|
"{} ",
|
||||||
colors::green(format!("Deno {upgrade_version} has been released."))
|
colors::green("A new canary release of Deno is available.")
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
eprint!(
|
||||||
|
"{} {} → {} ",
|
||||||
|
colors::green("A new release of Deno is available:"),
|
||||||
|
colors::cyan(version::deno()),
|
||||||
|
colors::cyan(upgrade_version)
|
||||||
|
);
|
||||||
|
}
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"{}",
|
"{}",
|
||||||
colors::italic_gray("Run `deno upgrade` to install it.")
|
colors::italic_gray("Run `deno upgrade` to install it.")
|
||||||
|
|
Loading…
Reference in a new issue