make dokku ls pretty

This commit is contained in:
Michael Hobbs committed 2015-04-21 22:02:21 -07:00
1 parent 9d504fe93a
commit eb0935a691
2 files changed
+20 -18

No files matched your search

+8 -6
View File
@@ -109,18 +109,20 @@ case "$1" in
;; ;;
ls) ls)
apps=$(ls -d $DOKKU_ROOT/*/ 2>/dev/null) || (echo "You haven't depoyed any applications yet" && exit 1) dokku_apps=$(ls -d $DOKKU_ROOT/*/ 2>/dev/null) || (echo "You haven't depoyed any applications yet" && exit 1)
dokku_col_log_info2_quiet "App Name" "Container id" dokku_3col_log_info2_quiet "App Name" "Container Type" "Container Id"
for app in $apps; do for dokku_app in $dokku_apps; do
DOKKU_APP_CIDS=$(get_container_ids "$(basename $app)") APP=$(basename $dokku_app)
DOKKU_APP_CIDS=$(get_container_ids $APP)
if [[ -n $DOKKU_APP_CIDS ]]; then if [[ -n $DOKKU_APP_CIDS ]]; then
for DOKKU_APP_CID in $DOKKU_APP_CIDS; do for DOKKU_APP_CID in $DOKKU_APP_CIDS; do
dokku_col_log_msg "$(basename $app)" "$DOKKU_APP_CID" DOKKU_APP_CONTAINER_TYPE=$(grep -l $DOKKU_APP_CID $DOKKU_ROOT/$APP/CONTAINER.* | awk -F. '{ print $2 }')
dokku_3col_log_msg "$APP" "$DOKKU_APP_CONTAINER_TYPE" "$DOKKU_APP_CID"
done done
else else
dokku_col_log_msg "$(basename $app)" dokku_3col_log_msg "$APP" "NOT_DEPLOYED" "NOT_DEPLOYED"
fi fi
done done
;; ;;
+12 -12
View File
@@ -33,37 +33,37 @@ dokku_log_info2_quiet() {
fi fi
} }
dokku_col_log_info1() { dokku_3col_log_info1() {
printf "%-40s %-40s\n" "-----> $@" printf "%-30s %-30s %-30s\n" "-----> $@"
} }
dokku_col_log_info1_quiet() { dokku_3col_log_info1_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then
printf "%-40s %-40s\n" "-----> $@" printf "%-30s %-30s %-30s\n" "-----> $@"
else else
return 0 return 0
fi fi
} }
dokku_col_log_info2() { dokku_3col_log_info2() {
printf "%-40s %-40s\n" "=====> $@" printf "%-30s %-30s %-30s\n" "=====> $@"
} }
dokku_col_log_info2_quiet() { dokku_3col_log_info2_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then
printf "%-40s %-40s\n" "=====> $@" printf "%-30s %-30s %-30s\n" "=====> $@"
else else
return 0 return 0
fi fi
} }
dokku_col_log_msg() { dokku_3col_log_msg() {
printf "%-40s %-40s\n" "$@" printf "%-30s %-30s %-30s\n" "$@"
} }
dokku_col_log_msg_quiet() { dokku_3col_log_msg_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then if [[ -z "$DOKKU_QUIET_OUTPUT" ]];then
printf "%-40s %-40s\n" "$@" printf "%-30s %-30s %-30s\n" "$@"
else else
return 0 return 0
fi fi