Skip to content

datasette serve when invoked with --reload interprets the serve command as a file #2123

@cadeef

Description

@cadeef

When running datasette serve with the --reload flag, the serve command is picked up as a file argument:

$ datasette serve --reload test_db
Starting monitor for PID 13574.
Error: Invalid value for '[FILES]...': Path 'serve' does not exist.
Press ENTER or change a file to reload.

If a 'serve' file is created it launches properly (albeit with an empty database called serve):

$ touch serve; datasette serve --reload test_db
Starting monitor for PID 13628.
INFO:     Started server process [13628]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8001 (Press CTRL+C to quit)

Version (running from HEAD on main):

$ datasette --version
datasette, version 1.0a2

This issue appears to have existed for awhile as #1380 (comment) mentions the error in a different context.

I'm happy to debug and land a patch if it's welcome.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions