Skip to content

Commit ad96ef0

Browse files
authored
Merge pull request #373 from dpogue/resouce-file-overwrite
CB-14141: Don't duplicate resource files in xcodeproj
2 parents 9d2ea13 + e2c885f commit ad96ef0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/templates/scripts/cordova/lib/prepare.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,11 @@ function updateFileResources (cordovaProject, locations) {
503503
let targetPath = path.join(project.resources_dir, target);
504504
targetPath = path.relative(cordovaProject.root, targetPath);
505505

506-
project.xcode.addResourceFile(target);
506+
if (!fs.existsSync(targetPath)) {
507+
project.xcode.addResourceFile(target);
508+
} else {
509+
events.emit('warn', 'Overwriting existing resource file at ' + targetPath);
510+
}
507511

508512
resourceMap[targetPath] = src;
509513
});

0 commit comments

Comments
 (0)