feat: recache bash-completion output whenever actions are taken on plugins

While this slows down those actions, it ensures we never have out of date information.
This commit is contained in:
Jose Diaz-Gonzalez committed 2018-04-27 04:11:50 -04:00
1 parent 75ea7862cc
commit 172779f3d6
6 files changed
+12

No files matched your search

+7
View File
@@ -8,3 +8,10 @@ plugin_list_cmd() {
plugn version plugn version
plugn list plugn list
} }
plugin_prime_bash_completion() {
declare desc="primes the bash-completion cache"
dokku_log_info1_quiet "Priming bash-completion cache"
dokku --quiet help --all | awk '/^ /{ print $1 }' | sort > "/var/cache/dokku-completion"
}
+1
View File
@@ -9,6 +9,7 @@ plugin_disable_cmd() {
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable"
local PLUGIN="$2" local PLUGIN="$2"
disable_plugin "$PLUGIN" disable_plugin "$PLUGIN"
plugin_prime_bash_completion
} }
plugin_disable_cmd "$@" plugin_disable_cmd "$@"
+1
View File
@@ -9,6 +9,7 @@ plugin_enable_cmd() {
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
local PLUGIN="$2" local PLUGIN="$2"
enable_plugin "$PLUGIN" enable_plugin "$PLUGIN"
plugin_prime_bash_completion
} }
plugin_enable_cmd "$@" plugin_enable_cmd "$@"
+1
View File
@@ -20,6 +20,7 @@ plugin_install_cmd() {
plugn trigger install plugn trigger install
;; ;;
esac esac
plugin_prime_bash_completion
} }
plugin_install_cmd "$@" plugin_install_cmd "$@"
+1
View File
@@ -9,6 +9,7 @@ plugin_uninstall_cmd() {
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable" [[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
local PLUGIN="$2" local PLUGIN="$2"
uninstall_plugin "$PLUGIN" uninstall_plugin "$PLUGIN"
plugin_prime_bash_completion
} }
plugin_uninstall_cmd "$@" plugin_uninstall_cmd "$@"
+1
View File
@@ -10,6 +10,7 @@ plugin_update_cmd() {
plugn update "$PLUGIN" "$PLUGIN_COMMITTISH" plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
fi fi
plugn trigger update plugn trigger update
plugin_prime_bash_completion
} }
plugin_update_cmd "$@" plugin_update_cmd "$@"