make docker-options adhere to DOKKU_NOT_IMPLEMENTED_EXIT pattern

This commit is contained in:
Michael Hobbs
2015-04-03 10:51:23 -07:00
parent 6374178046
commit ba33c161f5
2 changed files with 7 additions and 3 deletions

6
dokku
View File

@@ -177,17 +177,17 @@ EOF
implemented=0 implemented=0
for script in $PLUGIN_PATH/*/commands; do for script in $PLUGIN_PATH/*/commands; do
set +e; $script "$@" ; exit_code=$? ; set -e set +e; $script "$@" ; exit_code=$? ; set -e
if [ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]; then if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue continue
fi fi
implemented=1 implemented=1
if [ "$exit_code" -ne "$DOKKU_VALID_EXIT" ]; then if [[ "$exit_code" -ne "$DOKKU_VALID_EXIT" ]]; then
exit $exit_code exit $exit_code
fi fi
done done
if [ "$implemented" -eq 0 ]; then if [[ "$implemented" -eq 0 ]]; then
dokku_log_warn "\`$*\` is not a dokku command." dokku_log_warn "\`$*\` is not a dokku command."
dokku_log_warn "See \`dokku help\` for a list of available commands." dokku_log_warn "See \`dokku help\` for a list of available commands."
exit 1 exit 1

View File

@@ -146,4 +146,8 @@ case "$1" in
EOF EOF
;; ;;
*)
exit $DOKKU_NOT_IMPLEMENTED_EXIT
;;
esac esac