Skip to content
Snippets Groups Projects
Commit 18871ffd authored by Eric Müller's avatar Eric Müller :mountain_bicyclist: Committed by Eleni Mathioulaki
Browse files

fix(cmd spec -y): add yaml doc separators (---)

parent ca07461b
No related branches found
No related tags found
No related merge requests found
...@@ -100,9 +100,14 @@ def spec(parser, args): ...@@ -100,9 +100,14 @@ def spec(parser, args):
# With --yaml, --json, or --format, just print the raw specs to output # With --yaml, --json, or --format, just print the raw specs to output
if args.format: if args.format:
first_doc = True
for spec in concrete_specs: for spec in concrete_specs:
if args.format == "yaml": if args.format == "yaml":
# use write because to_yaml already has a newline. # use write because to_yaml already has a newline.
if first_doc:
first_doc = False
else:
sys.stdout.write("---\n")
sys.stdout.write(spec.to_yaml(hash=ht.dag_hash)) sys.stdout.write(spec.to_yaml(hash=ht.dag_hash))
elif args.format == "json": elif args.format == "json":
print(spec.to_json(hash=ht.dag_hash)) print(spec.to_json(hash=ht.dag_hash))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment