Skip to content
Browse files
(ios) fix: resolve correct path to app info plist when multiple plist…
… files are present (#144).

When multiple plist files exists in a cordova-ios project (e.g. due to a plugin containing `<podspec>`), ConfigFile was updated under CB-5989 to select the app plist as the target for changes destined for *-Info.plist.
However, the change made under CB-5989 incorrectly constructed the path to the app plist by omitting the project name subdirectory from the path, causing the fix to fail to work.

This commit fixes this by correcting the constructed path to the app plist.
  • Loading branch information
dpa99c committed Jun 12, 2020
1 parent b5ba4db commit a18bf0e2774b40dda11e3475b11a2dc3639bdb80
Showing 2 changed files with 4 additions and 3 deletions.
@@ -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([
@@ -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;

0 comments on commit a18bf0e

Please sign in to comment.