Skip to content

Commit a8dfeab

Browse files
Remove dead variables and use isEqualToString instead of ==
1 parent 983d43b commit a8dfeab

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

AppBox/Common/CLISupportHelper/CLISupportHelper.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ + (BOOL)uninstall {
4141
[alert addButtonWithTitle:@"Yes"];
4242
[alert addButtonWithTitle:@"No"];
4343
if ([alert runModal] == NSAlertFirstButtonReturn){
44-
NSError *error;
4544
if ([self runScript:@"uninstall.sh"]){
4645
[Common showAlertWithTitle:@"Success" andMessage:@"AppBox CLI tool uninstalled successfully."];
4746
return YES;
4847
}else{
49-
[Common showAlertWithTitle:@"Error" andMessage:[NSString stringWithFormat:@"Failed to uninstall AppBox CLI tool.\n\n%@", error.localizedDescription]];
48+
[Common showAlertWithTitle:@"Error" andMessage:@"Failed to uninstall AppBox CLI tool."];
5049
return NO;
5150
}
5251
} else {
@@ -75,12 +74,11 @@ + (BOOL)installPromptAfterLogin {
7574
+ (BOOL)updatePromptAfterVersionUpdate {
7675
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"];
7776
NSString *cliVersion = [UserData cliVersion];
78-
if (appVersion == cliVersion || cliVersion.isEmpty) {
77+
if ([appVersion isEqualToString:cliVersion] || cliVersion.isEmpty) {
7978
return NO;
8079
}
8180

82-
BOOL hasNewCLIVersion = YES;
83-
if (![NSFileManager.defaultManager fileExistsAtPath:abCLIPath] || !hasNewCLIVersion) {
81+
if (![NSFileManager.defaultManager fileExistsAtPath:abCLIPath]) {
8482
return NO;
8583
}
8684

0 commit comments

Comments
 (0)