From 32d7d802791e9ad5d0b900d546814053cd99e28f Mon Sep 17 00:00:00 2001 From: sergey filyanin Date: Fri, 19 Jul 2024 11:44:41 +0200 Subject: [PATCH] Update renew-config.sh --- scripts/renew-config.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/renew-config.sh b/scripts/renew-config.sh index 09b1e9d..eeed96d 100755 --- a/scripts/renew-config.sh +++ b/scripts/renew-config.sh @@ -10,21 +10,21 @@ testnet_meta_url="https://github.com/gear-tech/gear/releases/download/v"$tag"/te production_meta_url="https://github.com/gear-tech/gear/releases/download/v"$tag"/production_vara_runtime_v"$version"_metadata.scale" echo "Downloading testnet metadata from $testnet_meta_url" -testnet_metadata=$(curl -L $testnet_meta_url) +curl -L $testnet_meta_url -o testnet_metadata.scale if [ $? -ne 0 ]; then echo "Failed to download testnet metadata" exit 1 fi echo "Downloading production metadata from $production_meta_url" -production_metadata=$(curl -L $production_meta_url) +curl -L $production_meta_url -o production_metadata.scale if [ $? -ne 0 ]; then echo "Failed to download production metadata" exit 1 fi echo "Updating testnet config" -jq --arg metadata "$testnet_metadata" --argjson version "$version" \ +jq --argfile metadata testnet_metadata.scale --argjson version "$version" \ '.metadataRpc = $metadata | .specVersion = $version' \ "$TESTNET_CONFIG_PATH" > tmp.$$.json \ && mv tmp.$$.json "$TESTNET_CONFIG_PATH" @@ -35,10 +35,14 @@ if [ $? -ne 0 ]; then fi echo "Updating mainnet config" -jq --arg metadata "$production_metadata" --argjson version "$version" \ +jq --argfile metadata production_metadata.scale --argjson version "$version" \ '.metadataRpc = $metadata | .specVersion = $version' \ "$MAINNET_CONFIG_PATH" > tmp.$$.json \ && mv tmp.$$.json "$MAINNET_CONFIG_PATH" if [ $? -ne 0 ]; then - echo "Failed to update mainnet config + echo "Failed to update mainnet config" + exit 1 +fi + +echo "Configuration update completed successfully"