mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(GUI): escape quotes from image paths (#598)
Consider a directory name such as `Juan's Files`. When passing such path as an argument to the child writer proxy script, Bash will complain with: > Unexpected EOF while looking for matching `'` The solution is to manually escape quotes on the image path. Change-Type: patch Changelog-Entry: Escape quotes from image paths to prevent Bash errors on GNU/Linux and OS X. Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
7e0f54e7d6
commit
be8f4bfce7
@ -81,11 +81,10 @@ exports.getCLIWriterArguments = (options) => {
|
||||
return options.image;
|
||||
}
|
||||
|
||||
// Parenthesis need to be manually escaped,
|
||||
// otherwise bash will complain about syntax
|
||||
// errors when passing this string as an
|
||||
// argument to the writer proxy script.
|
||||
return options.image.replace(/([\(\)])/g, '\\$1');
|
||||
// Parenthesis and quotes need to be manually escaped, otherwise
|
||||
// bash will complain about syntax errors when passing this
|
||||
// string as an argument to the writer proxy script.
|
||||
return options.image.replace(/([\(\)'"])/g, '\\$1');
|
||||
|
||||
}),
|
||||
'--robot',
|
||||
|
Loading…
x
Reference in New Issue
Block a user