mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Filter null/undefined arguments on Windows
These won't be able to be properly quoted
This commit is contained in:
parent
c37e4649b5
commit
44860ba572
@ -44,15 +44,14 @@ class BufferedProcess
|
||||
if process.platform is "win32"
|
||||
# Quote all arguments and escapes inner quotes
|
||||
if args?
|
||||
cmdArgs = args.filter (arg) -> arg?
|
||||
cmdArgs = args.map (arg) ->
|
||||
if command in ['explorer.exe', 'explorer'] and /^\/[a-zA-Z]+,.*$/.test(arg)
|
||||
# Don't wrap /root,C:\folder style arguments to explorer calls in
|
||||
# quotes since they will not be interpreted correctly if they are
|
||||
arg
|
||||
else if typeof arg is 'string'
|
||||
"\"#{arg.replace(/"/g, '\\"')}\""
|
||||
else
|
||||
arg
|
||||
"\"#{arg.toString().replace(/"/g, '\\"')}\""
|
||||
else
|
||||
cmdArgs = []
|
||||
if /\s/.test(command)
|
||||
|
Loading…
Reference in New Issue
Block a user