Skip to content

Commit

Permalink
Update renew-config.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyfilyanin authored Jul 19, 2024
1 parent 32d7d80 commit 3c4496e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/renew-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ if [ $? -ne 0 ]; then
fi

echo "Updating testnet config"
jq --argfile metadata testnet_metadata.scale --argjson version "$version" \
# Read metadata and escape for JSON
testnet_metadata=$(cat testnet_metadata.scale | jq -Rsa .)
jq --arg metadata "$testnet_metadata" --argjson version "$version" \
'.metadataRpc = $metadata | .specVersion = $version' \
"$TESTNET_CONFIG_PATH" > tmp.$$.json \
&& mv tmp.$$.json "$TESTNET_CONFIG_PATH"
Expand All @@ -35,7 +37,9 @@ if [ $? -ne 0 ]; then
fi

echo "Updating mainnet config"
jq --argfile metadata production_metadata.scale --argjson version "$version" \
# Read metadata and escape for JSON
production_metadata=$(cat production_metadata.scale | jq -Rsa .)
jq --arg metadata "$production_metadata" --argjson version "$version" \
'.metadataRpc = $metadata | .specVersion = $version' \
"$MAINNET_CONFIG_PATH" > tmp.$$.json \
&& mv tmp.$$.json "$MAINNET_CONFIG_PATH"
Expand Down

0 comments on commit 3c4496e

Please sign in to comment.