datasette publish --name=now-accepts-name

Fixes #72
pull/81/head
Simon Willison 2017-11-12 18:12:21 -08:00
rodzic 2bbe9ca34a
commit ff2fb573cd
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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 = [