mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-01 13:53:11 +08:00
Rename
This commit is contained in:
37
ios/RCTPushy/BSDiff/BSDiff.m
Normal file
37
ios/RCTPushy/BSDiff/BSDiff.m
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// BSDiff.m
|
||||
// RCTPushy
|
||||
//
|
||||
// Created by lvbingru on 16/4/2.
|
||||
// Copyright © 2016年 erica. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BSDiff.h"
|
||||
#include "bspatch.h"
|
||||
|
||||
|
||||
@implementation BSDiff
|
||||
|
||||
+ (BOOL)bsdiffPatch:(NSString *)patch
|
||||
origin:(NSString *)origin
|
||||
toDestination:(NSString *)destination
|
||||
{
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:patch]) {
|
||||
return NO;
|
||||
}
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:origin]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:destination]) {
|
||||
[[NSFileManager defaultManager] removeItemAtPath:destination error:nil];
|
||||
}
|
||||
|
||||
int err = beginPatch([origin UTF8String], [destination UTF8String], [patch UTF8String]);
|
||||
if (err) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user