Renamed "datasette build" command to "datasette inspect"

Closes #130
sanic-07
Simon Willison 2017-12-07 08:57:31 -08:00
rodzic 80bf3afa43
commit 0539905806
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 17E2DEA2588B7F52
3 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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)

Wyświetl plik

@ -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(