From b308b03546ed647a34a51cab9f46db5c3d98732a Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Tue, 18 Jun 2024 23:05:37 -0400 Subject: [PATCH] only watch `$REPO/relay` directory with dev run command --- dev.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dev.py b/dev.py index f72e346..38499d8 100755 --- a/dev.py +++ b/dev.py @@ -126,15 +126,19 @@ def cli_run(dev: bool) -> None: if dev: cmd.append('-d') - handle_run_watcher(cmd) + handle_run_watcher(cmd, watch_path = REPO.joinpath("relay")) -def handle_run_watcher(*commands: Sequence[str], wait: bool = False) -> None: +def handle_run_watcher( + *commands: Sequence[str], + watch_path: Path | str = REPO, + wait: bool = False) -> None: + handler = WatchHandler(*commands, wait = wait) handler.run_procs() watcher = Observer() - watcher.schedule(handler, str(REPO), recursive=True) # type: ignore + watcher.schedule(handler, str(watch_path), recursive=True) # type: ignore watcher.start() # type: ignore try: