-
Notifications
You must be signed in to change notification settings - Fork 5
/
convert.sh
executable file
·35 lines (28 loc) · 1.86 KB
/
convert.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
echo "<!-- AUTOGENERATED FILE DO NOT EDIT -->" > README.md
echo "" >> README.md
echo "# XION Mainnet Contracts" >> README.md
echo "" >> README.md
echo "Contract information for XION mainnet" >> README.md
echo "" >> README.md
echo "## Development" >> README.md
echo "" >> README.md
echo "### Compiling" >> README.md
echo "" >> README.md
echo "\`\`\`bash" >> README.md
echo "" >> README.md
echo "docker run --rm -v \"\$(pwd)\":/code \\" >> README.md
echo " --mount type=volume,source=\"\$(basename \"\$(pwd)\")_cache\",target=/target \\" >> README.md
echo " --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\" >> README.md
echo " cosmwasm/optimizer:0.16.1" >> README.md
echo "" >> README.md
echo "\`\`\`" >> README.md
echo "" >> README.md
echo "## Deployed Contracts" >> README.md
echo "| Name | Description | Release | Author | Code ID | Hash | Governance Proposal |" >> README.md
echo "|:-----|:------------|:--------|:-------|:--------|:-----|:-------------------|" >> README.md
jq -r '.[] | select(.deprecated != true) | "| \(.name) | \(.description // "") | \(if .release then "[\(.release.version)](\(.release.url))" else "" end) | \(if .author then "[\(.author.name)](\(.author.url))" else "" end) | `\(.code_id // "")` | `\(.hash)` | \(.governance // "") |"' contracts.json >> README.md
echo "## Deprecated Contracts" >> README.md
echo "| Name | Description | Release | Author | Code ID | Hash | Governance Proposal |" >> README.md
echo "|:-----|:------------|:--------|:-------|:--------|:-----|:-------------------|" >> README.md
jq -r '.[] | select(.deprecated == true) | "| \(.name) | \(.description // "") | \(if .release then "[\(.release.version)](\(.release.url))" else "" end) | \(if .author then "[\(.author.name)](\(.author.url))" else "" end) | `\(.code_id // "")` | `\(.hash)` | \(.governance // "") |"' contracts.json >> README.md