From 0e02670639095d31522fc237eba84b132b50bc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Wed, 16 Sep 2015 17:22:57 +0200 Subject: [PATCH] Fix compatibility with dokku 0.4+ --- commands | 13 ++++++++++--- docker-args | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/commands b/commands index 2dcadaf..691899f 100755 --- a/commands +++ b/commands @@ -1,11 +1,18 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" + +PLUGIN_BASE_PATH="$PLUGIN_PATH" +if [[ -n $DOKKU_API_VERSION ]]; then + PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH" +fi +source "$PLUGIN_BASE_PATH/common/functions" source "$(dirname "$0")/functions" source "$(dirname "$0")/config" -if [[ ! -d $PLUGIN_DATA_ROOT ]]; then - dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugins-install" +if [[ $1 == $PLUGIN_COMMAND_PREFIX:* ]]; then + if [[ ! -d $PLUGIN_DATA_ROOT ]]; then + dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugin:install" + fi fi case "$1" in diff --git a/docker-args b/docker-args index 35e1a6b..35f05be 100755 --- a/docker-args +++ b/docker-args @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +PLUGIN_BASE_PATH="$PLUGIN_PATH" +if [[ -n $DOKKU_API_VERSION ]]; then + PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH" +fi +source "$PLUGIN_BASE_PATH/common/functions" source "$(dirname "$0")/functions" source "$(dirname "$0")/config"