Skip to content

Commit f37220d

Browse files
committed
fix(installer): remove vp.exe fallback in setup_bin_shims, require vp-shim.exe
1 parent e778d21 commit f37220d

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

crates/vite_installer/src/main.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,20 +310,15 @@ async fn setup_bin_shims(
310310

311311
#[cfg(windows)]
312312
{
313-
let shim_dst = bin_dir.join("vp.exe");
314313
let shim_src = install_dir.join("current").join("bin").join("vp-shim.exe");
314+
let shim_dst = bin_dir.join("vp.exe");
315315

316-
// Prefer vp-shim.exe (lightweight trampoline), fall back to vp.exe
317-
let src = if tokio::fs::try_exists(&shim_src).await.unwrap_or(false) {
318-
shim_src
319-
} else {
320-
install_dir.join("current").join("bin").join("vp.exe")
321-
};
322-
323-
if tokio::fs::try_exists(&src).await.unwrap_or(false) {
324-
replace_windows_exe(&src, &shim_dst, &bin_dir).await?;
316+
if !tokio::fs::try_exists(&shim_src).await.unwrap_or(false) {
317+
return Err(format!("vp-shim.exe not found at {}", shim_src.as_path().display()).into());
325318
}
326319

320+
replace_windows_exe(&shim_src, &shim_dst, &bin_dir).await?;
321+
327322
// Best-effort cleanup of old shim files
328323
if let Ok(mut entries) = tokio::fs::read_dir(&bin_dir).await {
329324
while let Ok(Some(entry)) = entries.next_entry().await {

0 commit comments

Comments
 (0)