From be8f4bfce7eed729fde1edcb6ee0baa89d517930 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 26 Jul 2016 08:50:58 -0400 Subject: [PATCH] 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 --- lib/src/child-writer/utils.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/src/child-writer/utils.js b/lib/src/child-writer/utils.js index 4564b84b..3885759d 100644 --- a/lib/src/child-writer/utils.js +++ b/lib/src/child-writer/utils.js @@ -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',