Skip to content

Commit 4b5a11e

Browse files
lfportalclaude
andcommitted
Preserve counters across mint loop in anvil_mint_tokens.sh
Piping jq into while ran the loop in a subshell, so increments to SUCCESS_COUNT, SKIP_COUNT, and FAIL_COUNT were discarded when the subshell exited. The final summary always printed 0 for all three. Drive the loop with process substitution instead so the counters live in the parent shell and the summary reflects actual results. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b1c1571 commit 4b5a11e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/anvil_mint_tokens.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ SUCCESS_COUNT=0
108108
SKIP_COUNT=0
109109
FAIL_COUNT=0
110110

111-
jq -c '.[]' "$TOKENS_FILE" | while read -r token; do
111+
while read -r token; do
112112
TOKEN_INT=$(echo "$token" | jq -r '.token_int')
113113
AMOUNT=$(echo "$token" | jq -r '.unquantised_sum')
114114
TICKER=$(echo "$token" | jq -r '.ticker_symbol')
@@ -167,7 +167,7 @@ jq -c '.[]' "$TOKENS_FILE" | while read -r token; do
167167
fi
168168
fi
169169
fi
170-
done
170+
done < <(jq -c '.[]' "$TOKENS_FILE")
171171

172172
# Stop impersonation if we started it
173173
if [ -z "$PRIVATE_KEY" ]; then

0 commit comments

Comments
 (0)