Skip to content

Commit

Permalink
[Fix] Escape backslashes in PowerShell ArgumentList (#3658)
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandMC authored Apr 19, 2024
1 parent 76e63a9 commit 4f3d892
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backend/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,10 @@ async function callRunner(
isWindows && !!(await searchForExecutableOnPath('powershell'))

if (shouldUsePowerShell) {
const argsAsString = commandParts.map((part) => `"\`"${part}\`""`).join(',')
const argsAsString = commandParts
.map((part) => part.replaceAll('\\', '\\\\'))
.map((part) => `"\`"${part}\`""`)
.join(',')
commandParts = [
'Start-Process',
`"\`"${fullRunnerPath}\`""`,
Expand Down

0 comments on commit 4f3d892

Please sign in to comment.