Fix abra app ls for app → type

This commit is contained in:
3wc 2021-01-01 23:00:20 +02:00
parent 6ba2657dc1
commit d6b4a4744f

6
abra
View File

@ -555,7 +555,7 @@ sub_app_list (){
for i in "${!ENV_FILES[@]}"; do
# Output header inside the loop, so it's included in the pipe to `column`
if [ "$i" == 0 ]; then
printf " DOMAIN\tAPP\tSERVER%s%s\n" "${STATUS:+ }" "${STATUS:+STATUS}"
printf " DOMAIN\tTYPE\tSERVER%s%s\n" "${STATUS:+ }" "${STATUS:+STATUS}"
printf " --\t--\t--%s\n" "${STATUS:+ --}"
fi
@ -569,7 +569,7 @@ sub_app_list (){
set -a
# shellcheck disable=SC1090
APP="$(source "$ENV_FILE" && echo "$APP")"
TYPE="$(source "$ENV_FILE" && echo "$TYPE")"
# shellcheck disable=SC1090
APP_STACK_NAME="$(source "$ENV_FILE" && echo "$STACK_NAME")"
set +a
@ -580,7 +580,7 @@ sub_app_list (){
if [ -n "$STATUS" ]; then
APP_STATUS=$( printf '%s\n' "${DEPLOYED_APPS[@]}" | grep -qP "^${SERVER}~${APP_STACK_NAME}$" && echo "deployed" || echo "inactive")
fi
printf " %s\t%s\t%s%s\n" "$DOMAIN" "$APP" "$SERVER" "${STATUS:+ }${APP_STATUS}"
printf " %s\t%s\t%s%s\n" "$DOMAIN" "$TYPE" "$SERVER" "${STATUS:+ }${APP_STATUS}"
done | column -s' ' -t
# Align table `-t` based on tab characters -s`^V<Tab>`
}