From d6d5b1438e2e89fa3ddaf9d948d812277a6a4b4a Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Sat, 1 Aug 2020 21:44:27 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20executableFolderPath=20to?= =?UTF-8?q?=20run=20app=20name=20in=20iOS=2014.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform-ios/src/commands/runIOS/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/platform-ios/src/commands/runIOS/index.ts b/packages/platform-ios/src/commands/runIOS/index.ts index d358ae939..cff985379 100644 --- a/packages/platform-ios/src/commands/runIOS/index.ts +++ b/packages/platform-ios/src/commands/runIOS/index.ts @@ -373,18 +373,22 @@ function bootSimulator(selectedSimulator: Device) { } } -function getTargetBuildDir(buildSettings: string) { +function getTargetPaths(buildSettings: string) { const settings = JSON.parse(buildSettings); // Find app in all building settings - look for WRAPPER_EXTENSION: 'app', for (const i in settings) { const wrapperExtension = settings[i].buildSettings.WRAPPER_EXTENSION; + if (wrapperExtension === 'app') { - return settings[i].buildSettings.TARGET_BUILD_DIR; + return { + targetBuildDir: settings[i].buildSettings.TARGET_BUILD_DIR, + executableFolderPath: settings[i].buildSettings.EXECUTABLE_FOLDER_PATH, + }; } } - return null; + return {}; } function getBuildPath( @@ -420,12 +424,17 @@ function getBuildPath( ], {encoding: 'utf8'}, ); - const targetBuildDir = getTargetBuildDir(buildSettings); + const {targetBuildDir, executableFolderPath} = getTargetPaths(buildSettings); + if (!targetBuildDir) { throw new CLIError('Failed to get the target build directory.'); } - return `${targetBuildDir}/${appName}.app`; + if (!executableFolderPath) { + throw new CLIError('Failed to get the app name.'); + } + + return `${targetBuildDir}/${executableFolderPath}`; } function getProductName(buildOutput: string) {