Skip to content

Commit 60ac724

Browse files
committed
fix: error with missing AppResources Podfile and override pods
1 parent 0c79359 commit 60ac724

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/services/cocoapods-service.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,14 @@ ${versionResolutionHint}`);
259259

260260
private overridePodsFromFile(podfileContent: string, projectData: IProjectData, platformData: IPlatformData): string {
261261
const mainPodfilePath = this.getMainPodFilePath(projectData, platformData);
262-
const mainPodfileContent = this.$fs.readText(mainPodfilePath);
263-
const pods = this.getCocoaPodsFromPodfile(mainPodfileContent);
264-
_.forEach(pods, pod => {
265-
podfileContent = podfileContent.replace(new RegExp(`^[ ]*pod\\s*["']${pod}['"].*$`, "gm"), '#$&');
266-
});
262+
263+
if (this.$fs.exists(mainPodfilePath)) {
264+
const mainPodfileContent = this.$fs.readText(mainPodfilePath);
265+
const pods = this.getCocoaPodsFromPodfile(mainPodfileContent);
266+
_.forEach(pods, pod => {
267+
podfileContent = podfileContent.replace(new RegExp(`^[ ]*pod\\s*["']${pod}['"].*$`, "gm"), '#$&');
268+
});
269+
}
267270

268271
return podfileContent;
269272
}

0 commit comments

Comments
 (0)