From 7b32e5fa109bf0891337ed4a84228be8b9e76b77 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 3 Oct 2020 17:18:21 +0200 Subject: [PATCH] Fix cumulate.jq not found --- lib/scanTxWallets.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/scanTxWallets.sh b/lib/scanTxWallets.sh index 6732704..c4df684 100755 --- a/lib/scanTxWallets.sh +++ b/lib/scanTxWallets.sh @@ -241,7 +241,17 @@ scanTxWallets() { echo "]" >> $jsonFile # On génère le JSON équivalent avec données cumulatives - jq -f $GPATH/lib/cumulate.jq $jsonFile > $GPATH/db/cum-daily.json + jqCumulate="def roundit: (.*100.0)+ 0.5|floor/100.0; + [foreach .[] as \$row (null; + .nbrMembers += \$row.nbrMembers | + .nbrWallets += \$row.nbrWallets | + .sMembers = (\$row.sMembers + .sMembers|roundit) | + .rMembers = (\$row.rMembers + .rMembers|roundit) | + .sWallets = (\$row.sWallets + .sWallets|roundit) | + .rWallets = (\$row.rWallets + .rWallets|roundit); + \$row + . )]" + + jq "$jqCumulate" $jsonFile > $GPATH/db/cum-daily.json # On supprime les doublons et les lignes vides wallets=$(echo -e "$wallets" | sort -u | awk 'NF')