Skip to content

Commit 36231bc

Browse files
committed
fix(installer): pause before closing in interactive mode
When double-clicked, the console window closes immediately after installation finishes. Users never see the success/error message. Add a 'Press Enter to close...' prompt in interactive mode so users can read the output. Silent mode (-y, CI) exits immediately.
1 parent 1698430 commit 36231bc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crates/vite_installer/src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async fn run(mut opts: cli::Options) -> i32 {
7676
}
7777
}
7878

79-
match do_install(&opts, &install_dir).await {
79+
let code = match do_install(&opts, &install_dir).await {
8080
Ok(()) => {
8181
print_success(&opts, &install_dir_display);
8282
0
@@ -85,7 +85,15 @@ async fn run(mut opts: cli::Options) -> i32 {
8585
print_error(&format!("{e}"));
8686
1
8787
}
88+
};
89+
90+
// When running interactively (double-click), pause so the user can
91+
// read the output before the console window closes.
92+
if !opts.yes {
93+
read_input(" Press Enter to close...");
8894
}
95+
96+
code
8997
}
9098

9199
#[allow(clippy::print_stdout)]

0 commit comments

Comments
 (0)