publish now takes a required publisher argument - only current option is 'now'

Closes #76
pull/81/head
Simon Willison 2017-11-13 10:40:51 -08:00
rodzic 4fec50597a
commit 20d41c8e8e
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -26,6 +26,7 @@ def build(files, inspect_file):
@cli.command()
@click.argument('publisher', type=click.Choice(['now']))
@click.argument('files', type=click.Path(exists=True), nargs=-1)
@click.option(
'-n', '--name', default='datasette',
@ -35,7 +36,15 @@ def build(files, inspect_file):
'-m', '--metadata', type=click.File(mode='r'),
help='Path to JSON file containing metadata to publish'
)
def publish(files, name, metadata):
def publish(publisher, files, name, metadata):
"""
Publish specified SQLite database files to the internet along with a datasette API.
Only current option for PUBLISHER is 'now'. You must have Zeit Now installed:
https://zeit.co/now
Example usage: datasette publish now my-database.db
"""
if not shutil.which('now'):
click.secho(
' The publish command requires "now" to be installed and configured ',