Skip to content

Commit 1e811ea

Browse files
committed
Fix issue #19 - double CTRL-C to exit with reload.
1 parent ffa2676 commit 1e811ea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/render_engine_cli/event.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ def watch(self) -> None:
124124

125125
console.print(f"[yellow]Serving {self.output_path}[/yellow]")
126126
while not self.stop_watcher():
127-
if self.dirs_to_watch:
128-
for _ in watchfiles.watch(*self.dirs_to_watch):
129-
self.rebuild()
127+
try:
128+
if self.dirs_to_watch:
129+
for _ in watchfiles.watch(*self.dirs_to_watch):
130+
self.rebuild()
131+
except KeyboardInterrupt:
132+
break
130133

131134
def __enter__(self):
132135
"""Starting Context manager for the class"""

0 commit comments

Comments
 (0)