@@ -152,21 +152,27 @@ def _patch_reverse_id(service_plist_path):
152
152
print ("Attempting to patch reverse id in Info.plist" )
153
153
with open (service_plist_path , "rb" ) as f :
154
154
service_plist = plistlib .load (f )
155
- _patch_file (
156
- path = os .path .join (os .path .dirname (service_plist_path ), "testapp" , "Info.plist" ),
157
- placeholder = "REPLACE_WITH_REVERSED_CLIENT_ID" ,
158
- value = service_plist ["REVERSED_CLIENT_ID" ])
155
+ try :
156
+ _patch_file (
157
+ path = os .path .join (os .path .dirname (service_plist_path ), "testapp" , "Info.plist" ),
158
+ placeholder = "REPLACE_WITH_REVERSED_CLIENT_ID" ,
159
+ value = service_plist ["REVERSED_CLIENT_ID" ])
160
+ except KeyError as e :
161
+ print ("Warning: Couldn't patch %s in %s" % (e .args [0 ], service_plist_path ))
159
162
160
163
161
164
def _patch_bundle_id (service_plist_path ):
162
165
"""Patches the Info.plist file with the bundle id from the Service plist."""
163
166
print ("Attempting to patch bundle id in Info.plist" )
164
167
with open (service_plist_path , "rb" ) as f :
165
168
service_plist = plistlib .load (f )
166
- _patch_file (
167
- path = os .path .join (os .path .dirname (service_plist_path ), "testapp" , "Info.plist" ),
168
- placeholder = "$(PRODUCT_BUNDLE_IDENTIFIER)" ,
169
- value = service_plist ["BUNDLE_ID" ])
169
+ try :
170
+ _patch_file (
171
+ path = os .path .join (os .path .dirname (service_plist_path ), "testapp" , "Info.plist" ),
172
+ placeholder = "$(PRODUCT_BUNDLE_IDENTIFIER)" ,
173
+ value = service_plist ["BUNDLE_ID" ])
174
+ except KeyError as e :
175
+ print ("Warning: Couldn't patch %s in %s" % (e .args [0 ], service_plist_path ))
170
176
171
177
172
178
def _patch_file (path , placeholder , value ):
0 commit comments