Check if command is implemented in a plugin before executing plugin code

Because of how plugin commands are implemented, their output can be incredibly verbose. Rather than executing even the `set -eo pipefail` parts of a plugin, we immediately check if the command is implemented by a plugin. If it is not, then we continue on as normal.

One side-effect of this change is that plugin commands need to be duplicated again:

- once in the command array
- once for the actual body of the command
- once in the help output

This is also quite hackish, and probably not the best way to decrease trace output. Note that we drop approximately 2k lines worth of logs with this change.
This commit is contained in:
Jose Diaz-Gonzalez
2015-09-17 02:43:51 -07:00
parent 467264d31f
commit 70511c340d
15 changed files with 15 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
[[ " shell help shell:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in