From 507fd996adc8f977418d12b431c7e5aafb667f4a Mon Sep 17 00:00:00 2001 From: poka Date: Wed, 31 Mar 2021 15:09:02 +0200 Subject: [PATCH] Add username to json members profiles --- scripts/geoloc-members-json.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/geoloc-members-json.sh b/scripts/geoloc-members-json.sh index 82966dc..bf8bb8f 100755 --- a/scripts/geoloc-members-json.sh +++ b/scripts/geoloc-members-json.sh @@ -32,7 +32,9 @@ for i in $DATA_MBR; do continue else isMbr='"isMember": true,' - resultWithMbr=$(echo "$result" | sed "s/\"geoPoint\": {/$isMbr \"geoPoint\": {/g") + userId=$(jaklis id -p $i | jq .idty.username) + userIdFormat="\"userId\": $userId," + resultWithMbr=$(echo "$result" | sed "s/\"geoPoint\": {/$userIdFormat $isMbr \"geoPoint\": {/g") echo "$resultWithMbr," >> $FILE fi done @@ -55,3 +57,5 @@ echo "}" >> $FILE echo "]" >> $FILE [[ -f $FINAL_LOCATION ]] && cat $FILE | jq . > $FINAL_LOCATION + +