mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
--get now calls startup() plugin hooks, closes #934
This commit is contained in:
parent
7702ea6021
commit
45414f8412
4 changed files with 59 additions and 21 deletions
|
|
@ -416,12 +416,6 @@ def serve(
|
|||
|
||||
ds = Datasette(files, **kwargs)
|
||||
|
||||
if get:
|
||||
client = TestClient(ds.app())
|
||||
response = client.get(get)
|
||||
click.echo(response.text)
|
||||
return
|
||||
|
||||
if return_instance:
|
||||
# Private utility mechanism for writing unit tests
|
||||
return ds
|
||||
|
|
@ -432,6 +426,12 @@ def serve(
|
|||
# Run async sanity checks - but only if we're not under pytest
|
||||
asyncio.get_event_loop().run_until_complete(check_databases(ds))
|
||||
|
||||
if get:
|
||||
client = TestClient(ds.app())
|
||||
response = client.get(get)
|
||||
click.echo(response.text)
|
||||
return
|
||||
|
||||
# Start the server
|
||||
if root:
|
||||
print("http://{}:{}/-/auth-token?token={}".format(host, port, ds._root_token))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue