Use dokku_apps for listing apps instead of re-inventing the wheel

This commit is contained in:
Jose Diaz-Gonzalez committed 2016-01-02 02:31:34 -05:00
1 parent 40047f0f8b
commit 51a50fb571
1 file changed
+3 -3
+3 -3
View File
@@ -7,13 +7,13 @@ source "$PLUGIN_AVAILABLE_PATH/apps/functions"
case "$1" in case "$1" in
apps) apps)
dokku_log_info2_quiet "My Apps" dokku_log_info2_quiet "My Apps"
find $DOKKU_ROOT -follow -maxdepth 1 -type d \( ! -iname ".*" \) -not -path $DOKKU_ROOT/tls | sed 's|^\./||g' | sed 's|'$DOKKU_ROOT'\/||' | tail -n +2 | sort dokku_apps
;; ;;
apps:create) apps:create)
apps_create $2 apps_create $2
;; ;;
apps:rename) apps:rename)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -d "$DOKKU_ROOT/$3" ]] && dokku_log_fail "Name is already taken" [[ -d "$DOKKU_ROOT/$3" ]] && dokku_log_fail "Name is already taken"
@@ -31,7 +31,7 @@ case "$1" in
plugn trigger post-app-rename $OLD_APP $NEW_APP plugn trigger post-app-rename $OLD_APP $NEW_APP
echo "Renaming $OLD_APP to $NEW_APP... done" echo "Renaming $OLD_APP to $NEW_APP... done"
;; ;;
apps:destroy) apps:destroy)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
[[ "$2" == "tls" ]] && dokku_log_fail "Unable to destroy tls directory" [[ "$2" == "tls" ]] && dokku_log_fail "Unable to destroy tls directory"