Skip to content

Commit

Permalink
fix: pick correct TARGET_BUILD_DIR for run-ios (#1032)
Browse files Browse the repository at this point in the history
* ci: fix wrong TARGET_BUILD_DIR

* ci: better version of detecting right build settings
  • Loading branch information
FDiskas authored Mar 4, 2020
1 parent a70064b commit 45edfd0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/platform-ios/src/commands/runIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,17 @@ function bootSimulator(selectedSimulator: Device) {
}

function getTargetBuildDir(buildSettings: string) {
const targetBuildMatch = /TARGET_BUILD_DIR = (.+)$/m.exec(buildSettings);
return targetBuildMatch && targetBuildMatch[1]
? targetBuildMatch[1].trim()
: null;
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 null;
}

function getBuildPath(
Expand Down Expand Up @@ -403,6 +410,7 @@ function getBuildPath(
'-configuration',
configuration,
'-showBuildSettings',
'-json',
],
{encoding: 'utf8'},
);
Expand Down

0 comments on commit 45edfd0

Please sign in to comment.