Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/vite_global_cli/src/commands/env/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ fn render_env_content(shell: EnvShell, vite_plus_home: &vite_path::AbsolutePath)
// Normalize to forward slashes for $HOME/... paths (POSIX-style)
format!("$HOME/{}", s.display().to_string().replace('\\', "/"))
})
.unwrap_or_else(|| bin_path.as_path().display().to_string());
.unwrap_or_else(|| bin_path.as_path().display().to_string().replace('\\', "/"));
Comment thread
Aalivexy marked this conversation as resolved.
Comment thread
Aalivexy marked this conversation as resolved.

match shell {
EnvShell::Posix => ENV_TEMPLATE_POSIX.replace("__VP_BIN__", &bin_path_ref),
Expand Down Expand Up @@ -976,7 +976,7 @@ mod tests {

// Should use absolute path since install dir is not under HOME
let expected_bin = home.join("bin");
let expected_str = expected_bin.as_path().display().to_string();
let expected_str = expected_bin.as_path().display().to_string().replace('\\', "/");
assert!(
env_content.contains(&expected_str),
"env file should use absolute path {expected_str}, got: {env_content}"
Expand Down
Loading