From 89b221d72b8e82eed5b9bb60557e5df9d63e6f78 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com> Date: Thu, 17 Apr 2025 12:58:36 -0400 Subject: [PATCH] fix(ui): update version formatting to use cyan color (#12943) ## Summary This PR simplifies the version formatting by replacing `.white()` with `.cyan()` styling for consistency. Resolves #12940 ## Test Plan I manually recreated the code and tested it with this patch: ```diff diff --git i/crates/uv/src/lib.rs w/crates/uv/src/lib.rs index b9c01b002..cf051351f 100644 --- i/crates/uv/src/lib.rs +++ w/crates/uv/src/lib.rs @@ -1019,6 +1019,20 @@ async fn run(mut cli: Cli) -> Result { }) => commands::self_update(target_version, token, printer).await, #[cfg(not(feature = "self-update"))] Commands::Self_(_) => { + eprintln!("{}: {}", "error".cyan().bold(), "fake error message"); + + let version_information = format!( + "from {} to {}", + "v0.1.1".bold().cyan(), + "v0.1.2".bold().cyan(), + ); + eprintln!( + "{}{} Upgraded uv {}! {}", + "success".green().bold(), + ":".bold(), + version_information, + format!("https://github.com/astral-sh/uv/releases/tag/{}", "v0.1.2").cyan() + ); anyhow::bail!( "uv was installed through an external package manager, and self-update \ is not available. Please use your package manager to update uv." ``` In a light terminal, this is what it looks like: image --- crates/uv/src/commands/self_update.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/uv/src/commands/self_update.rs b/crates/uv/src/commands/self_update.rs index c1ef22a8f..c0214cc28 100644 --- a/crates/uv/src/commands/self_update.rs +++ b/crates/uv/src/commands/self_update.rs @@ -96,11 +96,11 @@ pub(crate) async fn self_update( let version_information = if let Some(old_version) = result.old_version { format!( "from {} to {}", - format!("v{old_version}").bold().white(), - format!("v{}", result.new_version).bold().white(), + format!("v{old_version}").bold().cyan(), + format!("v{}", result.new_version).bold().cyan(), ) } else { - format!("to {}", format!("v{}", result.new_version).bold().white()) + format!("to {}", format!("v{}", result.new_version).bold().cyan()) }; writeln!( @@ -127,7 +127,7 @@ pub(crate) async fn self_update( "{}{} You're on the latest version of uv ({})", "success".green().bold(), ":".bold(), - format!("v{}", env!("CARGO_PKG_VERSION")).bold().white() + format!("v{}", env!("CARGO_PKG_VERSION")).bold().cyan() ) )?; }