Skip to content

Commit

Permalink
ci: default to null and continue for missing rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Jan 21, 2025
1 parent dae67fc commit 79453a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions shell/tokenlist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ for file in src/tokens/*.json; do
# Extract the filename and replace '-' with '_'
network=$(basename "$file" .json | tr '-' '_' | tr '[:lower:]' '[:upper:]')

echo -n "Decimals for $network tokens list: "
echo -n "$network tokens list: "

# Construct the RPC URL variable name from filename
rpc_url_var="${network}_RPC_URL"

# Load the RPC URL from the environment variable
rpc_url=${!rpc_url_var}
# Load the RPC URL from the environment variable or default to empty string if not found
rpc_url=${!rpc_url_var:-}

if [ -z "$rpc_url" ]; then
echo -e "🟡 missing RPC endpoint."
continue
fi

# Loop through JSON objects and extract address and token decimals
echo "$json_objects" | jq -c '.[]' | while read -r row; do
Expand Down

0 comments on commit 79453a3

Please sign in to comment.