only watch $REPO/relay directory with dev run command

This commit is contained in:
Izalia Mae 2024-06-18 23:05:37 -04:00
parent 5407027af8
commit b308b03546

10
dev.py
View file

@ -126,15 +126,19 @@ def cli_run(dev: bool) -> None:
if dev: if dev:
cmd.append('-d') 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 = WatchHandler(*commands, wait = wait)
handler.run_procs() handler.run_procs()
watcher = Observer() 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 watcher.start() # type: ignore
try: try: