Improve watch mode behaviour

This commit is contained in:
object-Object 2023-10-09 20:35:13 -04:00
parent a92a4716a5
commit 2517b2daa1
2 changed files with 11 additions and 2 deletions

View file

@ -1,5 +1,9 @@
{
"watch": ["doc/src/hexdoc/_templates", "doc/properties.toml"],
"watch": [
"doc/src/hexdoc/_templates",
"doc/properties.toml",
"Common/src/main/resources/assets/hexcasting/lang"
],
"ignore": ["**/generated/**"],
"ext": "jinja,html,css,js,toml,json,json5",
"exec": "hexdoc serve doc/properties.toml --src _site/src/docs --dst _site/dst/docs --lang en_us --allow-missing --release"

View file

@ -202,7 +202,12 @@ def serve(
f"Serving web book at http://localhost:{port}{book_url} (press ctrl+c to exit)\n"
)
with HTTPServer(("", port), SimpleHTTPRequestHandler) as httpd:
httpd.serve_forever()
# ignore KeyboardInterrupt to stop Typer from printing "Aborted."
# because it keeps printing after nodemon exits and breaking the output
try:
httpd.serve_forever()
except KeyboardInterrupt:
pass
if __name__ == "__main__":