fix(diskpart): Fix diskpart argv when tmpdir contains spaces

This escapes the diskpart script filename when shelling out,
to avoid failure when the username and thus the `os.tmpdir()` path
contains spaces.

Change-Type: patch
This commit is contained in:
Jonas Hermsmeier 2018-05-17 16:18:15 +02:00
parent 995177498f
commit 2045066b16
No known key found for this signature in database
GPG Key ID: 1B870F801A0CEE9F

View File

@ -69,7 +69,7 @@ const runDiskpart = (commands, callback) => {
}, (writeError) => {
debug('write %s:', filename, writeError || 'OK')
childProcess.exec(`diskpart /s ${filename}`, (execError, stdout, stderr) => {
childProcess.execFile('diskpart', [ '/s', filename ], (execError, stdout, stderr) => {
debug('stdout:', stdout)
debug('stderr:', stderr)