feat: implement apps:list

Also deprecate the `apps` command in favor of `apps:list`
This commit is contained in:
Jose Diaz-Gonzalez
2017-02-20 17:18:29 -07:00
parent 05bf33805f
commit 9614f7dca2
4 changed files with 24 additions and 14 deletions

View File

@@ -7,10 +7,11 @@ case "$1" in
help_content_func () {
declare desc="return apps plugin help content"
cat<<help_content
apps, List your apps
apps, Alias for apps:list (Deprecated)
apps:clone <old-app> <new-app>, Clones an app
apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app
apps:list, List your apps
apps:rename <old-app> <new-app>, Rename an app
apps:report [<app>] [<flag>], Display report about an app
help_content

14
plugins/apps/internal-functions Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
apps_list_cmd() {
declare desc="lists all apps"
local cmd="apps"
local app
dokku_log_info2_quiet "My Apps"
for app in $(dokku_apps); do
echo "$app"
done
}

View File

@@ -1,16 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
apps_main_cmd() {
declare desc="lists all apps"
local cmd="apps"
local app
dokku_log_info2_quiet "My Apps"
for app in $(dokku_apps); do
echo "$app"
done
}
apps_main_cmd "$@"
dokku_log_warn "Deprecated: Please use apps:list"
apps_list_cmd "$@"

5
plugins/apps/subcommands/list Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
apps_list_cmd "$@"