feat: Allow setting root path for file watcher

This commit is contained in:
Paul Gauthier 2024-12-17 13:23:55 -08:00 committed by Paul Gauthier (aider)
parent c708e8ba8e
commit e7bec5be1d

View file

@ -66,10 +66,10 @@ class FileWatcher:
# Compiled regex pattern for AI comments
ai_comment_pattern = re.compile(r"(?:#|//|--) *(ai\b.*|ai\b.*|.*\bai[?!]?) *$", re.IGNORECASE)
def __init__(self, coder, gitignores=None, verbose=False, analytics=None):
def __init__(self, coder, gitignores=None, verbose=False, analytics=None, root=None):
self.coder = coder
self.io = coder.io
self.root = Path(coder.root)
self.root = Path(root) if root else Path(coder.root)
self.verbose = verbose
self.analytics = analytics
self.stop_event = None