Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Copy cmd.exe if the path contains any of thes characters: ` ' " & | <…
Browse files Browse the repository at this point in the history
… > ^
  • Loading branch information
zvin committed Sep 15, 2020
1 parent 81cab70 commit f23153e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@ function Windows(instance, callback) {
}

function WindowsCopyCmd(instance, end) {
const specialChars = /&`'"<>\|\^/;
if (!specialChars.test(instance.path)) {
end();
return;
}
// Work around https://github.com/jorangreef/sudo-prompt/issues/97
// Powershell can't properly escape amperstands in paths.
// We work around this by copying cmd.exe in our temporary folder and running
Expand Down

0 comments on commit f23153e

Please sign in to comment.