Skip to content

Commit

Permalink
test: use symlinks to copy shells
Browse files Browse the repository at this point in the history
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 <rod@vagg.org>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
John Kleinschmidt authored and BridgeAR committed Apr 28, 2020
1 parent 1996198 commit f4e9bd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-exec-any-shells-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const test = (shell) => {
}));
};
const testCopy = (shellName, shellPath) => {
// Copy the executable to a path with spaces, to ensure there are no issues
// Symlink the executable to a path with spaces, to ensure there are no issues
// related to quoting of argv0
const copyPath = `${tmpPath}\\${shellName}`;
fs.copyFileSync(shellPath, copyPath);
fs.symlinkSync(shellPath, copyPath);
test(copyPath);
};

Expand Down

0 comments on commit f4e9bd6

Please sign in to comment.