From f4e9bd6d36e428e83095a7d6107c8849d53438f4 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 7 Apr 2020 11:06:32 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/32129 Reviewed-By: Rod Vagg Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau --- test/parallel/test-child-process-exec-any-shells-windows.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 8cdd03d7e510d5..0e78b665689720 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -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); };