@@ -207,8 +207,8 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
207
207
return failCallback (error);
208
208
}
209
209
210
- NSString * downloadFilePath = [self getDownloadFilePath ];
211
- NSString * bundleFilePath = [newPackageFolderPath stringByAppendingPathComponent: UpdateBundleFileName];
210
+ NSString *downloadFilePath = [self getDownloadFilePath ];
211
+ NSString *bundleFilePath = [newPackageFolderPath stringByAppendingPathComponent: UpdateBundleFileName];
212
212
213
213
CodePushDownloadHandler *downloadHandler = [[CodePushDownloadHandler alloc ]
214
214
init: downloadFilePath
@@ -229,12 +229,11 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
229
229
nonFailingError = nil ;
230
230
}
231
231
232
- NSString * diffManifestFilePath = [unzippedFolderPath
233
- stringByAppendingPathComponent: DiffManifestFileName];
232
+ NSString *diffManifestFilePath = [unzippedFolderPath stringByAppendingPathComponent: DiffManifestFileName];
234
233
235
234
if ([[NSFileManager defaultManager ] fileExistsAtPath: diffManifestFilePath]) {
236
235
// Copy the current package to the new package.
237
- NSString * currentPackageFolderPath = [self getCurrentPackageFolderPath: &error];
236
+ NSString * currentPackageFolderPath = [self getCurrentPackageFolderPath: &error];
238
237
if (error) {
239
238
failCallback (error);
240
239
return ;
@@ -258,15 +257,13 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
258
257
}
259
258
260
259
NSData *data = [manifestContent dataUsingEncoding: NSUTF8StringEncoding];
261
- NSDictionary * manifestJSON = [NSJSONSerialization JSONObjectWithData: data
260
+ NSDictionary * manifestJSON = [NSJSONSerialization JSONObjectWithData: data
262
261
options: kNilOptions
263
262
error: &error];
264
263
NSArray *deletedFiles = manifestJSON[@" deletedFiles" ];
265
264
for (NSString *deletedFileName in deletedFiles) {
266
- [[NSFileManager defaultManager ]
267
- removeItemAtPath: [newPackageFolderPath
268
- stringByAppendingPathComponent: deletedFileName]
269
- error: &nonFailingError];
265
+ [[NSFileManager defaultManager ] removeItemAtPath: [newPackageFolderPath stringByAppendingPathComponent: deletedFileName]
266
+ error: &nonFailingError];
270
267
271
268
if (nonFailingError) {
272
269
NSLog (@" Error deleting file from current package: %@ " , nonFailingError);
@@ -286,7 +283,7 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
286
283
}
287
284
288
285
NSString *relativeBundlePath = [self findMainBundleInFolder: newPackageFolderPath
289
- error: &error];
286
+ error: &error];
290
287
if (error) {
291
288
failCallback (error);
292
289
return ;
@@ -314,13 +311,11 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
314
311
}
315
312
}
316
313
317
- NSData *updateSerializedData = [NSJSONSerialization
318
- dataWithJSONObject: mutableUpdatePackage
319
- options: 0
320
- error: &error];
321
- NSString *packageJsonString = [[NSString alloc ]
322
- initWithData: updateSerializedData
323
- encoding: NSUTF8StringEncoding];
314
+ NSData *updateSerializedData = [NSJSONSerialization dataWithJSONObject: mutableUpdatePackage
315
+ options: 0
316
+ error: &error];
317
+ NSString *packageJsonString = [[NSString alloc ] initWithData: updateSerializedData
318
+ encoding: NSUTF8StringEncoding];
324
319
325
320
[packageJsonString writeToFile: [newPackageFolderPath stringByAppendingPathComponent: @" app.json" ]
326
321
atomically: YES
0 commit comments