Skip to content

Commit

Permalink
use findPodfilePath
Browse files Browse the repository at this point in the history
  • Loading branch information
TMisiukiewicz committed Sep 18, 2023
1 parent e16e3fb commit 3615491
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cli-platform-ios/src/commands/buildIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function buildIOS(_: Array<string>, ctx: Config, args: FlagsT) {
}

const {xcodeProject, sourceDir} = ctx.project.ios;

console.log(ctx.dependencies);
// check if pods need to be installed
await resolvePods(ctx.root, {forceInstall: args.forcePods});

Expand Down
7 changes: 6 additions & 1 deletion packages/cli-platform-ios/src/tools/pods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getLoader,
} from '@react-native-community/cli-tools';
import installPods from './installPods';
import findPodfilePath from '../config/findPodfilePath';

interface ResolvePodsOptions {
forceInstall?: boolean;
Expand Down Expand Up @@ -40,7 +41,11 @@ export default async function resolvePods(
options?: ResolvePodsOptions,
) {
const packageJson = getPackageJson(root);
const podsPath = path.join(root, 'ios', 'Pods');
const podfilePath = findPodfilePath(root);
const iosFolderPath = podfilePath
? podfilePath.slice(0, podfilePath.lastIndexOf('/'))
: path.join(root, 'ios');
const podsPath = path.join(iosFolderPath, 'Pods');
const arePodsInstalled = fs.existsSync(podsPath);
const dependencies = normalizeDependencies({
...packageJson.dependencies,
Expand Down

0 comments on commit 3615491

Please sign in to comment.