Skip to content

Commit

Permalink
Merge branch 'main' into rclone-copy-stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jbusecke authored Oct 31, 2024
2 parents b83e24b + 0e2ff4f commit 3633d84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/catalog-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ jobs:
run: |
leap-catalog --help
leap-catalog validate --single https://github.com/leap-stc/proto_feedstock/blob/main/feedstock/catalog.yaml
leap-catalog generate --single https://github.com/carbonplan/ocean-carbon-sink-data-feedstock/blob/main/feedstock/catalog.yaml --output catalog/
cat catalog/output/consolidated-web-catalog.json | jq
leap-catalog generate --single https://github.com/carbonplan/ocean-carbon-sink-data-feedstock/blob/main/feedstock/catalog.yaml --output ./
cat ./output/single-feedstock-web-catalog.json | jq
9 changes: 7 additions & 2 deletions leap_data_management_utils/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,14 @@ def generate(args):
catalog = validate_feedstocks(feedstocks=feedstocks)
output = upath.UPath(args.output).resolve() / 'output'
output.mkdir(parents=True, exist_ok=True)
with open(f'{output}/consolidated-web-catalog.json', 'w') as f:
path = (
output / 'single-feedstock-web-catalog.json'
if args.single
else output / 'consolidated-web-catalog.json'
)
with open(path, 'w') as f:
json.dump(catalog, f, indent=2, default=pydantic_core.to_jsonable_python)
print(f'Catalog written to {output}/consolidated-web-catalog.json')
print(f'Catalog written to {path}')


def main():
Expand Down

0 comments on commit 3633d84

Please sign in to comment.