Skip to content

Commit 4eaea89

Browse files
committed
refactor: rename platform to platformConfig
1 parent 07d0d44 commit 4eaea89

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

packages/cli-platform-apple/src/commands/buildCommand/createBuild.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import {supportedPlatforms} from '../../config/supportedPlatforms';
1212
const createBuild =
1313
({platformName}: BuilderCommand) =>
1414
async (_: Array<string>, ctx: Config, args: BuildFlags) => {
15-
const platform = ctx.project[platformName] as IOSProjectConfig;
15+
const platformConfig = ctx.project[platformName] as IOSProjectConfig;
1616
if (
17-
platform === undefined ||
17+
platformConfig === undefined ||
1818
supportedPlatforms[platformName] === undefined
1919
) {
20-
throw new CLIError(`Unable to find ${platform} platform config`);
20+
throw new CLIError(`Unable to find ${platformConfig} platform config`);
2121
}
2222

2323
let installedPods = false;
24-
if (platform?.automaticPodsInstallation || args.forcePods) {
25-
const isAppRunningNewArchitecture = platform?.sourceDir
26-
? await getArchitecture(platform?.sourceDir)
24+
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
25+
const isAppRunningNewArchitecture = platformConfig?.sourceDir
26+
? await getArchitecture(platformConfig?.sourceDir)
2727
: undefined;
2828

2929
await resolvePods(ctx.root, ctx.dependencies, platformName, {
@@ -35,7 +35,7 @@ const createBuild =
3535
}
3636

3737
let {xcodeProject, sourceDir} = getXcodeProjectAndDir(
38-
platform,
38+
platformConfig,
3939
platformName,
4040
installedPods,
4141
);

packages/cli-platform-apple/src/commands/logCommand/createLog.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ type Args = {
2020
const createLog =
2121
({platformName}: BuilderCommand) =>
2222
async (_: Array<string>, ctx: Config, args: Args) => {
23-
const platform = ctx.project[platformName] as IOSProjectConfig;
23+
const platformConfig = ctx.project[platformName] as IOSProjectConfig;
2424
const {readableName: platformReadableName} = getPlatformInfo(platformName);
2525

2626
if (
27-
platform === undefined ||
27+
platformConfig === undefined ||
2828
supportedPlatforms[platformName] === undefined
2929
) {
30-
throw new CLIError(`Unable to find ${platform} platform config`);
30+
throw new CLIError(`Unable to find ${platformConfig} platform config`);
3131
}
3232

3333
// Here we're using two command because first command `xcrun simctl list --json devices` outputs `state` but doesn't return `available`. But second command `xcrun xcdevice list` outputs `available` but doesn't output `state`. So we need to connect outputs of both commands.

packages/cli-platform-apple/src/commands/runCommand/createRun.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ const createRun =
5151
async (_: Array<string>, ctx: Config, args: FlagsT) => {
5252
// React Native docs assume platform is always ios/android
5353
link.setPlatform('ios');
54-
const platform = ctx.project[platformName] as IOSProjectConfig;
54+
const platformConfig = ctx.project[platformName] as IOSProjectConfig;
5555
const {sdkNames, readableName: platformReadableName} =
5656
getPlatformInfo(platformName);
5757

5858
if (
59-
platform === undefined ||
59+
platformConfig === undefined ||
6060
supportedPlatforms[platformName] === undefined
6161
) {
6262
throw new CLIError(
@@ -67,9 +67,9 @@ const createRun =
6767
let {packager, port} = args;
6868
let installedPods = false;
6969
// check if pods need to be installed
70-
if (platform?.automaticPodsInstallation || args.forcePods) {
71-
const isAppRunningNewArchitecture = platform?.sourceDir
72-
? await getArchitecture(platform?.sourceDir)
70+
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
71+
const isAppRunningNewArchitecture = platformConfig?.sourceDir
72+
? await getArchitecture(platformConfig?.sourceDir)
7373
: undefined;
7474

7575
await resolvePods(ctx.root, ctx.dependencies, platformName, {
@@ -101,7 +101,7 @@ const createRun =
101101
}
102102

103103
let {xcodeProject, sourceDir} = getXcodeProjectAndDir(
104-
platform,
104+
platformConfig,
105105
platformName,
106106
installedPods,
107107
);

0 commit comments

Comments
 (0)