From 5a9f5ba3f988da3810d4d4a0b8bc626ba0cb4a98 Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Tue, 6 Apr 2021 04:51:37 -0500 Subject: [PATCH] feat: displays current version if rover is up to date (#408) Co-authored-by: Irina Shestak --- src/utils/version.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/version.rs b/src/utils/version.rs index 66c6e9e4e..8ba8fc90c 100644 --- a/src/utils/version.rs +++ b/src/utils/version.rs @@ -53,12 +53,12 @@ pub fn check_for_update(config: config::Config, force: bool) -> Result<()> { fn do_update_check(checked: &mut bool, should_output_if_updated: bool) -> Result<()> { let latest = get_latest_release()?; + let pretty_latest = Cyan.normal().paint(format!("v{}", latest)); let update_available = is_latest_newer(&latest, PKG_VERSION)?; - if update_available { let message = format!( "There is a newer version of Rover available: {} (currently running v{})\n\nFor instructions on how to install, run {}", - Cyan.normal().paint(format!("v{}", latest)), + &pretty_latest, PKG_VERSION, Yellow.normal().paint("`rover docs open start`") ); @@ -67,7 +67,10 @@ fn do_update_check(checked: &mut bool, should_output_if_updated: bool) -> Result .build() .eprint(message); } else if should_output_if_updated { - eprintln!("Rover is up to date!"); + eprintln!( + "Rover is up to date with the latest release {}.", + &pretty_latest + ); } *checked = true;