Skip to content

Commit e53abac

Browse files
committed
fix(installer): show selected dist-tag in interactive version summary
The interactive menu always showed "latest" as the version fallback, even when --tag alpha was passed. Now it correctly shows the tag value (e.g. "alpha") so the user sees what will actually be installed.
1 parent f37220d commit e53abac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/vite_installer/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ fn modify_path(bin_dir: &str, quiet: bool) -> Result<(), Box<dyn std::error::Err
396396
#[allow(clippy::print_stdout)]
397397
fn show_interactive_menu(opts: &mut cli::Options, install_dir: &str) -> bool {
398398
loop {
399-
let version = opts.version.as_deref().unwrap_or("latest");
399+
let version = opts.version.as_deref().unwrap_or(&opts.tag);
400400
let bin_dir = format!("{install_dir}{sep}bin", sep = std::path::MAIN_SEPARATOR);
401401

402402
println!();
@@ -440,7 +440,7 @@ fn show_interactive_menu(opts: &mut cli::Options, install_dir: &str) -> bool {
440440
#[allow(clippy::print_stdout)]
441441
fn show_customize_menu(opts: &mut cli::Options) {
442442
loop {
443-
let version_display = opts.version.as_deref().unwrap_or("latest");
443+
let version_display = opts.version.as_deref().unwrap_or(&opts.tag);
444444
let registry_display = opts.registry.as_deref().unwrap_or("(default)");
445445

446446
println!();
@@ -463,7 +463,7 @@ fn show_customize_menu(opts: &mut cli::Options) {
463463
"" => return,
464464
"1" => {
465465
let v = read_input(" Version (e.g. 0.3.0 or latest): ");
466-
if v == "latest" || v.is_empty() {
466+
if v.is_empty() || v == opts.tag {
467467
opts.version = None;
468468
} else {
469469
opts.version = Some(v);

0 commit comments

Comments
 (0)