Skip to content

Commit

Permalink
always filter application executable
Browse files Browse the repository at this point in the history
  • Loading branch information
iosdeveloper committed Feb 19, 2016
1 parent 952033e commit 0bae661
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions App/BitBar/PluginManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,12 @@ - (NSArray*) pluginFilesWithAsking:(BOOL)shouldAsk {
dirFiles = [dirFiles filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"NOT self BEGINSWITH '.'"]];
// filter markdown files
dirFiles = [dirFiles filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"NOT self ENDSWITH '.md'"]];
// filter application executable
// filter subdirectories
dirFiles = [dirFiles filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id name, NSDictionary *bindings) {
BOOL isDir;
NSString * path = [self.path stringByAppendingPathComponent:name];
#ifdef DISTRO
// filter application executable
return ![path isEqualToString:[NSBundle mainBundle].executablePath] && [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir] && !isDir;
#else
return [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir] && !isDir;
#endif
}]];
return dirFiles;
}
Expand Down

0 comments on commit 0bae661

Please sign in to comment.