gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] branch master updated: Fix error unbound variable - S


From: gnunet
Subject: [taler-deployment] branch master updated: Fix error unbound variable - Set to zero
Date: Fri, 22 Sep 2023 12:32:09 +0200

This is an automated email from the git hooks/post-receive script.

javier-sepulveda pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new fd7fd1e  Fix error unbound variable - Set to zero
fd7fd1e is described below

commit fd7fd1e825362fd916ff07361ef4494e26af6997
Author: Javier Sepulveda <javier.sepulveda@uv.es>
AuthorDate: Fri Sep 22 12:29:03 2023 +0200

    Fix error unbound variable - Set to zero
---
 sandcastle/utils/fund-rewards.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sandcastle/utils/fund-rewards.sh b/sandcastle/utils/fund-rewards.sh
index cf09723..d53bd99 100755
--- a/sandcastle/utils/fund-rewards.sh
+++ b/sandcastle/utils/fund-rewards.sh
@@ -38,9 +38,16 @@ JSON=$(taler-harness deployment tip-status \
 # Calculate remaining funds
 
 ACTIVE_FUNDS=$(echo "$JSON" | jq '[.reserves[] | select(.active)]')
-TOTAL_EXCHANGE_INITIAL_AMOUNT=$(echo "$ACTIVE_FUNDS" | jq --arg cur 
"$CURRENCY" '[.[].exchange_initial_amount | sub($cur + ":"; "") | tonumber] | 
add')
+
+# If there is ANY active reserve, then do the substraction
+if [[ $ACTIVE_FUNDS != "[]" ]]; then
+TOTAL_EXCHANGE_INITIAL_AMOUNT=$(echo "$ACTIVE_FUNDS" | jq --arg cur 
"$CURRENCY" '[.[].exchange_initial_amount | sub($cur + ":"; "") | tonumber] |>
 TOTAL_PICKUP_AMOUNT=$(echo "$ACTIVE_FUNDS" | jq --arg cur "$CURRENCY" 
'[.[].pickup_amount | sub($cur + ":"; "") | tonumber] | add')
 TOTAL_RESERVE_AMOUNT=$((TOTAL_EXCHANGE_INITIAL_AMOUNT - TOTAL_PICKUP_AMOUNT))
+else
+# Otherwise set variable to zero
+TOTAL_RESERVE_AMOUNT=0
+fi
 
 # Decide whether add a new reserve, or leave it as is.
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]