Skip to content

Commit 7e4a83d

Browse files
branchseerclaude
andcommitted
fix(e2e): inherit PATHEXT on Windows for executable lookup
When using native bash with env_clear(), the child process loses PATHEXT which is needed by the which crate to find executables with extensions like .exe and .cmd on Windows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0444f61 commit 7e4a83d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • crates/vite_task_bin/tests/e2e_snapshots

crates/vite_task_bin/tests/e2e_snapshots/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &Path, fixture_name: &str
168168
.env("NO_COLOR", "1")
169169
.current_dir(e2e_stage_path.join(&e2e.cwd));
170170

171+
// On Windows, inherit PATHEXT for executable lookup
172+
if cfg!(windows) {
173+
if let Ok(pathext) = std::env::var("PATHEXT") {
174+
cmd.env("PATHEXT", pathext);
175+
}
176+
}
177+
171178
let output = if let Some(stdin_content) = step.stdin() {
172179
cmd.stdin(Stdio::piped());
173180
cmd.stdout(Stdio::piped());

0 commit comments

Comments
 (0)