mirror of
https://github.com/denoland/deno.git
synced 2024-12-18 21:35:31 -05:00
fix(outdated): respect --quiet flag for hints (#27317)
This commit is contained in:
parent
21a9e2d42b
commit
7bab83d6c0
3 changed files with 22 additions and 3 deletions
|
@ -100,15 +100,14 @@ fn print_outdated_table(packages: &[OutdatedPackage]) {
|
||||||
println!("└{package_fill}┴{current_fill}┴{update_fill}┴{latest_fill}┘",);
|
println!("└{package_fill}┴{current_fill}┴{update_fill}┴{latest_fill}┘",);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::print_stdout)]
|
|
||||||
fn print_suggestion(compatible: bool) {
|
fn print_suggestion(compatible: bool) {
|
||||||
println!();
|
log::info!("");
|
||||||
let (cmd, txt) = if compatible {
|
let (cmd, txt) = if compatible {
|
||||||
("", "compatible")
|
("", "compatible")
|
||||||
} else {
|
} else {
|
||||||
(" --latest", "available")
|
(" --latest", "available")
|
||||||
};
|
};
|
||||||
println!(
|
log::info!(
|
||||||
"{}",
|
"{}",
|
||||||
color_print::cformat!(
|
color_print::cformat!(
|
||||||
"<p(245)>Run</> <u>deno outdated --update{}</> <p(245)>to update to the latest {} versions,</>\n<p(245)>or</> <u>deno outdated --help</> <p(245)>for more information.</>",
|
"<p(245)>Run</> <u>deno outdated --update{}</> <p(245)>to update to the latest {} versions,</>\n<p(245)>or</> <u>deno outdated --help</> <p(245)>for more information.</>",
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
{
|
{
|
||||||
"args": "outdated",
|
"args": "outdated",
|
||||||
"output": "outdated.out"
|
"output": "outdated.out"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Respect `--quiet flag and don't print hint how to update
|
||||||
|
"args": "outdated --quiet",
|
||||||
|
"output": "outdated_quiet.out"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
15
tests/specs/update/deno_json/outdated_quiet.out
Normal file
15
tests/specs/update/deno_json/outdated_quiet.out
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
┌────────────────────────────────────────────────┬─────────┬────────┬────────┐
|
||||||
|
│ Package │ Current │ Update │ Latest │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ jsr:@denotest/multiple-exports │ 0.2.0 │ 0.2.0 │ 1.0.0 │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ jsr:@denotest/subtract │ 0.2.0 │ 0.2.0 │ 1.0.0 │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ jsr:@denotest/add │ 0.2.0 │ 0.2.1 │ 1.0.0 │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ npm:@denotest/has-patch-versions │ 0.1.0 │ 0.1.1 │ 0.2.0 │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ npm:@denotest/bin │ 0.6.0 │ 0.6.0 │ 1.0.0 │
|
||||||
|
├────────────────────────────────────────────────┼─────────┼────────┼────────┤
|
||||||
|
│ npm:@denotest/breaking-change-between-versions │ 1.0.0 │ 1.0.0 │ 2.0.0 │
|
||||||
|
└────────────────────────────────────────────────┴─────────┴────────┴────────┘
|
Loading…
Reference in a new issue