From 05399058062ba6df467c8745b87ece5f6951b39f Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 7 Dec 2017 08:57:31 -0800 Subject: [PATCH] Renamed "datasette build" command to "datasette inspect" Closes #130 --- README.md | 4 ++-- datasette/cli.py | 4 ++-- datasette/utils.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 032a8dec..45cfe836 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ http://localhost:8001/History/downloads.jsono will return that data as JSON in a --sql_time_limit_ms INTEGER Max time allowed for SQL queries in ms --load-extension TEXT Path to a SQLite extension to load --inspect-file TEXT Path to JSON file created using "datasette - build" + inspect" -m, --metadata FILENAME Path to JSON file containing license/source metadata --help Show this message and exit. @@ -199,7 +199,7 @@ Here's example output for the package command: Step 4/7 : RUN pip install datasette ---> Using cache ---> 340efa82bfd7 - Step 5/7 : RUN datasette build parlgov.db --inspect-file inspect-data.json + Step 5/7 : RUN datasette inspect parlgov.db --inspect-file inspect-data.json ---> Using cache ---> 5fddbe990314 Step 6/7 : EXPOSE 8001 diff --git a/datasette/cli.py b/datasette/cli.py index cf4dbf84..cd5d69b2 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -26,7 +26,7 @@ def cli(): 'sqlite_extensions', '--load-extension', envvar='SQLITE_EXTENSIONS', multiple=True, type=click.Path(exists=True, resolve_path=True), help='Path to a SQLite extension to load' ) -def build(files, inspect_file, sqlite_extensions): +def inspect(files, inspect_file, sqlite_extensions): app = Datasette(files, sqlite_extensions=sqlite_extensions) open(inspect_file, 'w').write(json.dumps(app.inspect(), indent=2)) @@ -225,7 +225,7 @@ class StaticMount(click.ParamType): 'sqlite_extensions', '--load-extension', envvar='SQLITE_EXTENSIONS', multiple=True, type=click.Path(exists=True, resolve_path=True), help='Path to a SQLite extension to load' ) -@click.option('--inspect-file', help='Path to JSON file created using "datasette build"') +@click.option('--inspect-file', help='Path to JSON file created using "datasette inspect"') @click.option('-m', '--metadata', type=click.File(mode='r'), help='Path to JSON file containing license/source metadata') @click.option('-t', '--template-dir', type=click.Path(exists=True, file_okay=False, dir_okay=True), help='Path to directory containing custom templates') @click.option('-s', '--static', type=StaticMount(), help='mountpoint:path-to-directory for serving static files', multiple=True) diff --git a/datasette/utils.py b/datasette/utils.py index dc4055c0..e5ab1462 100644 --- a/datasette/utils.py +++ b/datasette/utils.py @@ -150,7 +150,7 @@ FROM python:3 COPY . /app WORKDIR /app RUN pip install {install_from} -RUN datasette build {files} --inspect-file inspect-data.json +RUN datasette inspect {files} --inspect-file inspect-data.json EXPOSE 8001 CMD [{cmd}]'''.format( files=' '.join(files), @@ -232,7 +232,7 @@ def temporary_heroku_directory(files, name, metadata, extra_options, branch=None open('requirements.txt', 'w').write(install_from) os.mkdir('bin') - open('bin/post_compile', 'w').write('datasette build --inspect-file inspect-data.json') + open('bin/post_compile', 'w').write('datasette inspect --inspect-file inspect-data.json') quoted_files = " ".join(map(shlex.quote, files)) procfile_cmd = 'web: datasette serve --host 0.0.0.0 {quoted_files} --cors --port $PORT --inspect-file inspect-data.json'.format(