From ff2fb573cd8773206a6df83229620928056e2ee2 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 12 Nov 2017 18:12:21 -0800 Subject: [PATCH] datasette publish --name=now-accepts-name Fixes #72 --- datasette/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/datasette/cli.py b/datasette/cli.py index 3055110e..4e6fc888 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -27,7 +27,8 @@ def build_metadata(files, metadata): @cli.command() @click.argument('files', type=click.Path(exists=True), nargs=-1) -def publish(files): +@click.option('-n', '--name', default='datasette') +def publish(files, name): if not shutil.which('now'): click.secho( ' The publish command requires "now" to be installed and configured ', @@ -40,7 +41,7 @@ def publish(files): sys.exit(1) tmp = tempfile.TemporaryDirectory() # We create a datasette folder in there to get a nicer now deploy name - datasette_dir = os.path.join(tmp.name, 'datasette') + datasette_dir = os.path.join(tmp.name, name) os.mkdir(datasette_dir) saved_cwd = os.getcwd() file_paths = [