Skip to content

Commit

Permalink
Merge pull request #148 from dpa99c/GH-144
Browse files Browse the repository at this point in the history
fix: resolve correct path to app info plist when multiple plist files are present (#144)
  • Loading branch information
dpa99c authored Jun 12, 2020
2 parents b5ba4db + a18bf0e commit 87167bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/ConfigChanges/ConfigFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('ConfigFile tests', function () {

it('should return *-Info.plist file', function () {
const projName = 'XXX';
const expectedPlistPath = `${projName}-Info.plist`;
const expectedPlistPath = `${projName}${path.sep}${projName}-Info.plist`;

ConfigFile.__set__('getIOSProjectname', () => projName);
spyOn(require('glob'), 'sync').and.returnValue([
Expand Down
5 changes: 3 additions & 2 deletions src/ConfigChanges/ConfigFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ function resolveConfigFilePath (project_dir, platform, file) {

// [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
if (matches.length > 1 && file.includes('-Info.plist')) {
const plistName = `${getIOSProjectname(project_dir)}-Info.plist`;
const plistPath = path.join(project_dir, plistName);
const projName = getIOSProjectname(project_dir);
const plistName = `${projName}-Info.plist`;
const plistPath = path.join(project_dir, projName, plistName);
if (matches.includes(plistPath)) return plistPath;
}
return filepath;
Expand Down

0 comments on commit 87167bd

Please sign in to comment.