Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improved type safety of platformConfig in createRun function #2286

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const createBuild =
({platformName}: BuilderCommand) =>
async (_: Array<string>, ctx: Config, args: BuildFlags) => {
const platformConfig = ctx.project[platformName] as IOSProjectConfig;

if (
platformConfig === undefined ||
supportedPlatforms[platformName] === undefined
Expand All @@ -21,9 +22,9 @@ const createBuild =
}

let installedPods = false;
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig?.sourceDir
? await getArchitecture(platformConfig?.sourceDir)
if (platformConfig.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig.sourceDir
? await getArchitecture(platformConfig.sourceDir)
: undefined;

await resolvePods(ctx.root, ctx.dependencies, platformName, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const createRun =
let {packager, port} = args;
let installedPods = false;
// check if pods need to be installed
if (platformConfig?.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig?.sourceDir
? await getArchitecture(platformConfig?.sourceDir)
if (platformConfig.automaticPodsInstallation || args.forcePods) {
const isAppRunningNewArchitecture = platformConfig.sourceDir
? await getArchitecture(platformConfig.sourceDir)
: undefined;

await resolvePods(ctx.root, ctx.dependencies, platformName, {
Expand Down
Loading