Skip to content

Commit c58a1a6

Browse files
authored
Merge pull request #5076 from NativeScript/kddimitrov/fix-override-pods-missing-resources-podfile
fix: error with missing AppResources Podfile and override pods
2 parents 3627814 + 60ac724 commit c58a1a6

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)