--reload now also reloads if databases change on disk

This commit is contained in:
Simon Willison 2018-12-20 07:51:08 -08:00
commit eac08f0dfc
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
2 changed files with 4 additions and 3 deletions

View file

@ -262,7 +262,7 @@ def package(
@click.option(
"--reload",
is_flag=True,
help="Automatically reload if code change detected - useful for development",
help="Automatically reload if database or code change detected - useful for development",
)
@click.option(
"--cors", is_flag=True, help="Enable CORS by serving Access-Control-Allow-Origin: *"
@ -345,6 +345,7 @@ def serve(
import hupper
reloader = hupper.start_reloader("datasette.cli.serve")
reloader.watch_files(files)
if metadata:
reloader.watch_files([metadata.name])