You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/02/14 09:55:12 UTC
[GitHub] [cordova-ios] sou2 commented on a change in pull request #765: Fix
error parsing plist_file_entry when adding extension in xcode
sou2 commented on a change in pull request #765: Fix error parsing plist_file_entry when adding extension in xcode
URL: https://github.com/apache/cordova-ios/pull/765#discussion_r379340409
##########
File path: bin/templates/scripts/cordova/lib/projectFile.js
##########
@@ -40,8 +40,19 @@ function parseProjectFile (locations) {
const xcodeproj = xcode.project(pbxPath);
xcodeproj.parseSync();
+ let projectName = '';
+ const workspaceCollection = fs.readdirSync(project_dir).find(d => d.includes('.xcworkspace'));
+ if (workspaceCollection) {
+ projectName = fs.readdirSync(project_dir).find(d => d.includes('.xcworkspace')).replace('.xcworkspace', '');
+ }
const xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection();
- const plist_file_entry = _.find(xcBuildConfiguration, entry => entry.buildSettings && entry.buildSettings.INFOPLIST_FILE);
+ const plist_file_entry = _.find(xcBuildConfiguration, function (entry) {
+ return (
+ entry.buildSettings &&
+ entry.buildSettings.INFOPLIST_FILE &&
+ projectName ? entry.buildSettings.INFOPLIST_FILE.includes(`${projectName}/${projectName}-Info.plist`) : true
Review comment:
The ternary operator (`? :`) needs to be enclosed in parenthesis. It has lower priority than the `&&` operator. Else, it crashes on my app because it returns true for an entry that has no `buildSettings`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org