From 800b5bca37bf71880c4fd7f016e3144b932b6add Mon Sep 17 00:00:00 2001 From: szymonrybczak Date: Fri, 22 Dec 2023 15:50:00 +0100 Subject: [PATCH] chore: apply reviewers comments --- .../getPropertyFromBuildSettings.ts | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 packages/cli-platform-apple/src/commands/runCommand/getPropertyFromBuildSettings.ts diff --git a/packages/cli-platform-apple/src/commands/runCommand/getPropertyFromBuildSettings.ts b/packages/cli-platform-apple/src/commands/runCommand/getPropertyFromBuildSettings.ts deleted file mode 100644 index 799d1d1ec..000000000 --- a/packages/cli-platform-apple/src/commands/runCommand/getPropertyFromBuildSettings.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {logger} from '@react-native-community/cli-tools'; -import chalk from 'chalk'; - -export function getPropertyFromBuildSettings( - buildSettings: string, - scheme: string, - propertyName: string, - target?: string, -): string | null { - const settings = JSON.parse(buildSettings); - - const targets = settings.map( - ({target: settingsTarget}: any) => settingsTarget, - ); - - let selectedTarget = targets[0]; - - if (target) { - if (!targets.includes(target)) { - logger.info( - `Target ${chalk.bold(target)} not found for scheme ${chalk.bold( - scheme, - )}, automatically selected target ${chalk.bold(selectedTarget)}`, - ); - } else { - selectedTarget = target; - } - } - - // Find app in all building settings - look for WRAPPER_EXTENSION: 'app', - const targetIndex = targets.indexOf(selectedTarget); - const targetSettings = settings[targetIndex].buildSettings; - - const wrapperExtension = targetSettings.WRAPPER_EXTENSION; - - if (wrapperExtension === 'app') { - return settings[targetIndex].buildSettings[propertyName]; - } - - return null; -}