mirror of
https://github.com/simonw/datasette.git
synced 2026-06-01 22:56:58 +02:00
Fix --reload interpreting 'serve' command as a file argument (#2646)
When hupper spawns the worker process, it calls the function specified by worker_path directly. Using "datasette.cli.serve" causes Click to parse sys.argv without going through the CLI group, so the literal word "serve" from the original command gets treated as a positional file argument. Change the worker path to "datasette.cli.cli" so the worker process goes through the Click group dispatcher, which properly recognizes "serve" as a subcommand and strips it from the argument list. Closes #2123 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
parent
24d801b7f7
commit
2bc1dd2275
1 changed files with 1 additions and 1 deletions
|
|
@ -547,7 +547,7 @@ def serve(
|
|||
if reload:
|
||||
import hupper
|
||||
|
||||
reloader = hupper.start_reloader("datasette.cli.serve")
|
||||
reloader = hupper.start_reloader("datasette.cli.cli")
|
||||
if immutable:
|
||||
reloader.watch_files(immutable)
|
||||
if config:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue