mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
--metadata accepts YAML as well as JSON - closes #713
This commit is contained in:
parent
2aaad72789
commit
6717c719dd
12 changed files with 149 additions and 25 deletions
|
|
@ -12,7 +12,7 @@ def add_common_publish_arguments_and_options(subcommand):
|
|||
"-m",
|
||||
"--metadata",
|
||||
type=click.File(mode="r"),
|
||||
help="Path to JSON file containing metadata to publish",
|
||||
help="Path to JSON/YAML file containing metadata to publish",
|
||||
),
|
||||
click.option(
|
||||
"--extra-options", help="Extra options to pass to datasette serve"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from .common import (
|
|||
add_common_publish_arguments_and_options,
|
||||
fail_if_publish_binary_not_installed,
|
||||
)
|
||||
from datasette.utils import link_or_copy, link_or_copy_directory
|
||||
from datasette.utils import link_or_copy, link_or_copy_directory, parse_metadata
|
||||
|
||||
|
||||
@hookimpl
|
||||
|
|
@ -154,7 +154,7 @@ def temporary_heroku_directory(
|
|||
file_names = [os.path.split(f)[-1] for f in files]
|
||||
|
||||
if metadata:
|
||||
metadata_content = json.load(metadata)
|
||||
metadata_content = parse_metadata(metadata.read())
|
||||
else:
|
||||
metadata_content = {}
|
||||
for key, value in extra_metadata.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue