From d9d255a7e2a67f10725e37bdd24a95b7f15a862a Mon Sep 17 00:00:00 2001 From: Angly Cat Date: Thu, 5 Apr 2018 15:56:34 +0600 Subject: [PATCH] Refactor product name resolving --- local-cli/runIOS/runIOS.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/local-cli/runIOS/runIOS.js b/local-cli/runIOS/runIOS.js index ac956a5d8c45e2..70dd5dedcbe354 100644 --- a/local-cli/runIOS/runIOS.js +++ b/local-cli/runIOS/runIOS.js @@ -226,10 +226,8 @@ function buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launc } //FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name, example output line: export FULL_PRODUCT_NAME="Super App Dev.app" let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/m.exec(buildOutput); - if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) { - return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name - } - return buildProcess.error ? reject(buildProcess.error) : resolve(); + //[0] of productNameMatch is the full match, [1] is the app name + return resolve(productNameMatch && productNameMatch.length && productNameMatch.length > 1 ? productNameMatch[1] : undefined); }); }); }