From f8c8172f372948aed3397bc1d7ca31b5cf0b49e0 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Fri, 23 Oct 2020 11:22:09 +0100 Subject: [PATCH] fix(ios): handle spaces in xcode path Fixes TIMOB-28207 --- iphone/cli/hooks/package.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/iphone/cli/hooks/package.js b/iphone/cli/hooks/package.js index 97397d8d8df..83b6a003bd8 100644 --- a/iphone/cli/hooks/package.js +++ b/iphone/cli/hooks/package.js @@ -253,18 +253,16 @@ exports.init = function (logger, config, cli) { fs.writeFileSync(exportsOptionsPlistFile, exportsOptions.toString('xml')); - // construct the command - const cmd = [ - builder.xcodeEnv.executables.xcodebuild, + const args = [ '-exportArchive', - '-archivePath', '"' + stagingArchiveDir + '"', - '-exportPath', '"' + outputDir + '"', - '-exportOptionsPlist', '"' + exportsOptionsPlistFile + '"' - ].join(' '); + '-archivePath', stagingArchiveDir, + '-exportPath', outputDir, + '-exportOptionsPlist', exportsOptionsPlistFile + ]; // execute! - logger.debug(__('Running: %s', cmd.cyan)); - exec(cmd, function (err, stdout, stderr) { + logger.debug(__('Running: %s %s', builder.xcodeEnv.executables.xcodebuild.cyan, args.join(' ').cyan)); + appc.subprocess.run(builder.xcodeEnv.executables.xcodebuild, args, function (err, stdout, stderr) { if (err) { const output = stderr.trim(); output.split('\n').forEach(logger.trace);