@@ -105,8 +105,8 @@ function getDefaultPlistPath() {
105105 return glob . sync ( `**/${ package . name } /*Info.plist` , ignoreNodeModules ) [ 0 ] ;
106106}
107107
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.
110110// So we suppose that proj name should be the same as package name, otherwise fallback to default plist path searching logic
111111function getBuildSettingsPropertyMatchingTargetProductName ( parsedXCodeProj , prop , targetProductName , build ) {
112112 var target ;
@@ -146,7 +146,7 @@ function getPlistPath(){
146146 var parsedXCodeProj ;
147147
148148 try {
149- var proj = xcode . project ( xcodeProjectPath ) ;
149+ var proj = xcode . project ( xcodeProjectPath ) ;
150150 //use sync version because there are some problems with async version of xcode lib as of current version
151151 parsedXCodeProj = proj . parseSync ( ) ;
152152 }
@@ -160,14 +160,16 @@ function getPlistPath(){
160160 var targetProductName = package ? package . name : null ;
161161
162162 //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 ) ||
164164 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 ) ||
166166 parsedXCodeProj . getBuildProperty ( INFO_PLIST_PROJECT_KEY ) ;
167167
168168 if ( ! plistPathValue ) {
169169 return getDefaultPlistPath ( ) ;
170170 }
171171
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' ) ) ;
173175}
0 commit comments