@@ -105,8 +105,8 @@ function getDefaultPlistPath() {
105
105
return glob . sync ( `**/${ package . name } /*Info.plist` , ignoreNodeModules ) [ 0 ] ;
106
106
}
107
107
108
- // This is enhanced version of standard implementation of xcode 'getBuildProperty' function
109
- // but allows us to narrow results by PRODUCT_NAME property also.
108
+ // This is enhanced version of standard implementation of xcode 'getBuildProperty' function
109
+ // but allows us to narrow results by PRODUCT_NAME property also.
110
110
// So we suppose that proj name should be the same as package name, otherwise fallback to default plist path searching logic
111
111
function getBuildSettingsPropertyMatchingTargetProductName ( parsedXCodeProj , prop , targetProductName , build ) {
112
112
var target ;
@@ -146,7 +146,7 @@ function getPlistPath(){
146
146
var parsedXCodeProj ;
147
147
148
148
try {
149
- var proj = xcode . project ( xcodeProjectPath ) ;
149
+ var proj = xcode . project ( xcodeProjectPath ) ;
150
150
//use sync version because there are some problems with async version of xcode lib as of current version
151
151
parsedXCodeProj = proj . parseSync ( ) ;
152
152
}
@@ -160,14 +160,16 @@ function getPlistPath(){
160
160
var targetProductName = package ? package . name : null ;
161
161
162
162
//Try to get 'Release' build of ProductName matching the package name first and if it doesn't exist then try to get any other if existing
163
- var plistPathValue = getBuildSettingsPropertyMatchingTargetProductName ( parsedXCodeProj , INFO_PLIST_PROJECT_KEY , targetProductName , RELEASE_BUILD_PROPERTY_NAME ) ||
163
+ var plistPathValue = getBuildSettingsPropertyMatchingTargetProductName ( parsedXCodeProj , INFO_PLIST_PROJECT_KEY , targetProductName , RELEASE_BUILD_PROPERTY_NAME ) ||
164
164
getBuildSettingsPropertyMatchingTargetProductName ( parsedXCodeProj , INFO_PLIST_PROJECT_KEY , targetProductName ) ||
165
- parsedXCodeProj . getBuildProperty ( INFO_PLIST_PROJECT_KEY , RELEASE_BUILD_PROPERTY_NAME ) ||
165
+ parsedXCodeProj . getBuildProperty ( INFO_PLIST_PROJECT_KEY , RELEASE_BUILD_PROPERTY_NAME ) ||
166
166
parsedXCodeProj . getBuildProperty ( INFO_PLIST_PROJECT_KEY ) ;
167
167
168
168
if ( ! plistPathValue ) {
169
169
return getDefaultPlistPath ( ) ;
170
170
}
171
171
172
- return path . resolve ( path . dirname ( xcodeProjectPath ) , '..' , plistPathValue ) ;
172
+ //also remove surrounding quotes from plistPathValue to get correct path resolved
173
+ //(see https://github.com/Microsoft/react-native-code-push/issues/534#issuecomment-302069326 for details)
174
+ return path . resolve ( path . dirname ( xcodeProjectPath ) , '..' , plistPathValue . replace ( / ^ " ( .* ) " $ / , '$1' ) ) ;
173
175
}
0 commit comments