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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
John Kleinschmidt authored and BethGriggs committed Apr 14, 2020
1 parent f6a9115 commit 9e5189a
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 9e5189a

Please sign in to comment.