Skip to content

Commit f4e9bd6

Browse files
John KleinschmidtBridgeAR
John Kleinschmidt
authored andcommitted
test: use symlinks to copy shells
Git for Windows includes `C:\Program Files\Git\bin\bash.exe`, which spawns ..\usr\bin\bash.exe, so copying that executable won't work. However, if a symlink is used to test paths with spaces, this executable will still work. PR-URL: #32129 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 1996198 commit f4e9bd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-child-process-exec-any-shells-windows.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const test = (shell) => {
2323
}));
2424
};
2525
const testCopy = (shellName, shellPath) => {
26-
// Copy the executable to a path with spaces, to ensure there are no issues
26+
// Symlink the executable to a path with spaces, to ensure there are no issues
2727
// related to quoting of argv0
2828
const copyPath = `${tmpPath}\\${shellName}`;
29-
fs.copyFileSync(shellPath, copyPath);
29+
fs.symlinkSync(shellPath, copyPath);
3030
test(copyPath);
3131
};
3232

0 commit comments

Comments
 (0)