Skip to content

Commit 237760d

Browse files
committed
fix: if a command argument contains one of the special characters it is now quoted
1 parent e97a785 commit 237760d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,16 @@ let runner = {
252252
runner.log('ERROR: Could not find the executable for step', step.displayName)
253253
}
254254

255-
// wrap args with " if they contain a space
255+
// wrap args with " if they contain a special character
256+
let specialChars = ' ~`#&$*()|[]{};\'<>?!'
257+
specialChars = specialChars.split('')
258+
256259
for (let arg in step.args) {
257-
if (step.args[arg].includes(' ')) {
258-
step.args[arg] = '"' + step.args[arg] + '"'
260+
for (let char of specialChars) {
261+
if (step.args[arg].includes(char)) {
262+
step.args[arg] = '"' + step.args[arg] + '"'
263+
break
264+
}
259265
}
260266
}
261267

0 commit comments

Comments
 (0)