Skip to content

Commit a3aca76

Browse files
committed
Fix bug in --ignore flag
1 parent bff648d commit a3aca76

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

alteza/engine.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,9 @@ def __init__(self) -> None:
471471
self.timeOfMostRecentEvent: Optional[int] = None
472472

473473
def on_any_event(self, event: FileSystemEvent) -> None:
474-
print(event)
474+
for ignoreAbsPath in Fs.ignoreAbsPaths:
475+
if ignoreAbsPath in event.src_path or ignoreAbsPath in event.dest_path:
476+
return
475477
self.timeOfMostRecentEvent = max(
476478
self.timeOfMostRecentEvent or 0, time.time_ns()
477479
)

alteza/fs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def defaultShouldIgnore(name: str, parentPath: str, isDir: bool) -> bool:
454454
return True
455455
fullPath = os.path.abspath(os.path.join(parentPath, name))
456456
for ignoreAbsPath in Fs.ignoreAbsPaths:
457-
if fullPath in ignoreAbsPath:
457+
if ignoreAbsPath in fullPath:
458458
return True
459459
return False
460460

0 commit comments

Comments
 (0)