Skip to content

Commit

Permalink
feat(docs): add script to improve docs description
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Oct 19, 2022
1 parent 7bdf548 commit b26698c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion contracts/cw-template/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[tasks.schema]
[tasks.generate_schema]
args = ["run", "--bin", "schema"]
command = "cargo"

[tasks.schema]
dependencies = ["generate_schema"]
script = '''
SCHEMA=$(find schema -type f -name '*.json' -print0)
TITLE=$(jq -r .contract_name $SCHEMA)
jq --arg description "$(cat README.md)" '. + {description: $description}' $SCHEMA > $SCHEMA.tmp && mv $SCHEMA.tmp $SCHEMA
jq --arg title $TITLE '. + {title: $title}' $SCHEMA > $SCHEMA.tmp && mv $SCHEMA.tmp $SCHEMA
'''

0 comments on commit b26698c

Please sign in to comment.