diff --git a/lib/src/child-writer/utils.js b/lib/src/child-writer/utils.js index e6c3c26f..4564b84b 100644 --- a/lib/src/child-writer/utils.js +++ b/lib/src/child-writer/utils.js @@ -17,6 +17,7 @@ 'use strict'; const _ = require('lodash'); +const os = require('os'); const Bluebird = require('bluebird'); const tmp = Bluebird.promisifyAll(require('tmp')); const packageJSON = require('../../../package.json'); @@ -75,7 +76,18 @@ exports.getBooleanArgumentForm = (argumentName, value) => { exports.getCLIWriterArguments = (options) => { const argv = [ options.entryPoint, - options.image, + _.attempt(() => { + if (os.platform() === 'win32') { + 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'); + + }), '--robot', '--drive', options.device,