From c64aa50c0e4219ef623a6ec3b939ac10a4568563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 11 Sep 2024 16:19:45 +0100 Subject: feat(upgrade): better error message on failure (#25503) Co-authored-by: crowlkats --- cli/args/flags.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'cli/args/flags.rs') diff --git a/cli/args/flags.rs b/cli/args/flags.rs index fbf58fff2..6d2611749 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -2986,12 +2986,8 @@ The declaration file could be saved and used for typing information.", ) } -fn upgrade_subcommand() -> Command { - command( - "upgrade", - cstr!("Upgrade deno executable to the given version. - -Latest +pub static UPGRADE_USAGE: &str = cstr!( + "Latest deno upgrade Specific version @@ -3002,7 +2998,15 @@ fn upgrade_subcommand() -> Command { Channel deno upgrade stable deno upgrade rc - deno upgrade canary + deno upgrade canary" +); + +fn upgrade_subcommand() -> Command { + command( + "upgrade", + color_print::cformat!("Upgrade deno executable to the given version. + +{} The version is downloaded from https://dl.deno.land and is used to replace the current executable. @@ -3010,7 +3014,7 @@ If you want to not replace the current Deno executable but instead download an u different location, use the --output flag: deno upgrade --output $HOME/my_deno -Read more: https://docs.deno.com/go/cmd/upgrade"), +Read more: https://docs.deno.com/go/cmd/upgrade", UPGRADE_USAGE), UnstableArgsConfig::None, ) .hide(cfg!(not(feature = "upgrade"))) -- cgit v1.2.3