From 978bf40d5a03da234e7120b74643afe97c2c5b31 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sat, 13 Aug 2022 15:26:50 -0600 Subject: [PATCH] new method of deploying check --- functions/update_apps.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/functions/update_apps.sh b/functions/update_apps.sh index 2db0b3a1..563f1913 100644 --- a/functions/update_apps.sh +++ b/functions/update_apps.sh @@ -14,16 +14,16 @@ it=0 while_count=0 while true do - if mapfile -t while_status < <(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) ; then + if while_status=$(cli -m csv -c 'app chart_release query name,update_available,human_version,human_latest_version,status' 2>/dev/null) ; then ((while_count++)) - [[ -z ${while_status[*]} ]] && continue || echo -e "$while_count\n${while_status[*]}" > temp.txt - for i in "${while_status[@]}" + [[ -z $while_status ]] && continue || echo -e "$while_count\n$while_status" > temp.txt + mapfile -t deploying_check < <(grep ",DEPLOYING," temp.txt) + for i in "${deploying_check[@]}" do app_name=$(echo "$i" | awk -F ',' '{print $1}') - status=$(echo "$i" | awk -F ',' '{print $2}') - if [[ $status == "DEPLOYING" ]]; then - [[ ! -e deploying ]] && touch deploying - grep -qs "$app_name,DEPLOYING" deploying || echo "$app_name,DEPLOYING" >> deploying + [[ ! -e deploying ]] && touch deploying + if ! grep -qs "$app_name,DEPLOYING" deploying; then + echo "$app_name,DEPLOYING" >> deploying fi done else