feat: add ability to check if a plugin has been installed
This commit is contained in:
@@ -12,6 +12,15 @@ cmd-plugin-list() {
|
||||
plugn list
|
||||
}
|
||||
|
||||
cmd-plugin-installed() {
|
||||
declare desc="checks if a plugin is installed"
|
||||
declare cmd="plugin:installed"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare PLUGIN_NAME="$1"
|
||||
|
||||
plugn list | awk '{print $1}' | grep -q "^${PLUGIN_NAME}$"
|
||||
}
|
||||
|
||||
plugin_prime_bash_completion() {
|
||||
declare desc="primes the bash-completion cache"
|
||||
|
||||
|
||||
6
plugins/plugin/subcommands/installed
Executable file
6
plugins/plugin/subcommands/installed
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/plugin/internal-functions"
|
||||
|
||||
cmd-plugin-installed "$@"
|
||||
Reference in New Issue
Block a user