mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
simplify the ignored path matching
This commit is contained in:
@@ -43,7 +43,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
NSString *path = [[(NSArray *)eventPaths objectAtIndex:i] stringByStandardizingPath];
|
||||
|
||||
if (useFileBasedListening)
|
||||
{
|
||||
{
|
||||
if (flags & kFSEventStreamEventFlagItemIsFile &&
|
||||
flags & kFSEventStreamEventFlagItemRemoved)
|
||||
{
|
||||
|
||||
@@ -282,9 +282,9 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
|
||||
if ([self isPathMatchingIgnoredPaths:fullPath] || ![fm fileExistsAtPath:fullPath])
|
||||
return;
|
||||
|
||||
|
||||
DLog(@"Parsing modified file: %@", fullPath);
|
||||
|
||||
|
||||
NSArray *arguments = nil;
|
||||
NSString *successTitle = nil;
|
||||
NSString *successMsg = nil;
|
||||
@@ -583,29 +583,24 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
{
|
||||
if ([ignoredPath length] == 0)
|
||||
continue;
|
||||
|
||||
NSMutableString *regexp = [NSMutableString stringWithFormat:@"%@/%@", [currentProjectURL path], ignoredPath];
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"/*/"
|
||||
withString:@"/*"
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
NSMutableString *regexp = [ignoredPath mutableCopy];
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"/"
|
||||
withString:@"\\/"
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"."
|
||||
withString:@"\\."
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"*"
|
||||
withString:@".*"
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@" "
|
||||
withString:@"\\ "
|
||||
options:0
|
||||
@@ -614,11 +609,9 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp];
|
||||
|
||||
if ([regextest evaluateWithObject:aPath])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user