From 83df40711cd3a698b18e0277cd92a293692bcc05 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Sep 2017 07:13:46 -0400 Subject: [PATCH] fix: ensure we create the config directory --- common-functions | 1 + config | 2 +- tests/test_helper.bash | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common-functions b/common-functions index 3e36add..aa4f026 100755 --- a/common-functions +++ b/common-functions @@ -328,6 +328,7 @@ service_linked_apps() { local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local LINKS_FILE="$SERVICE_ROOT/LINKS" + touch "$LINKS_FILE" [[ -z $(< "$LINKS_FILE") ]] && echo '-' && return 0 tr '\n' ' ' < "$LINKS_FILE" diff --git a/config b/config index 3411e99..ad82339 100644 --- a/config +++ b/config @@ -4,7 +4,7 @@ export MYSQL_IMAGE_VERSION=${MYSQL_IMAGE_VERSION:="5.7.12"} export MYSQL_ROOT=${MYSQL_ROOT:="/var/lib/dokku/services/mysql"} export PLUGIN_COMMAND_PREFIX="mysql" -export PLUGIN_CONFIG_ROOT="${DOKKU_LIB_ROOT}/config/${PLUGIN_COMMAND_PREFIX}" +export PLUGIN_CONFIG_ROOT=${PLUGIN_CONFIG_ROOT:="$DOKKU_LIB_ROOT/config/$PLUGIN_COMMAND_PREFIX"} export PLUGIN_DATA_ROOT=$MYSQL_ROOT export PLUGIN_DATASTORE_PORTS=(3306) export PLUGIN_DATASTORE_WAIT_PORT=3306 diff --git a/tests/test_helper.bash b/tests/test_helper.bash index 6852cff..7f743b2 100644 --- a/tests/test_helper.bash +++ b/tests/test_helper.bash @@ -10,6 +10,7 @@ export PLUGIN_AVAILABLE_PATH="$PLUGIN_PATH" export PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH" export MYSQL_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures" export PLUGIN_DATA_ROOT="$MYSQL_ROOT" +export PLUGIN_CONFIG_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" if [[ "$(uname)" == "Darwin" ]]; then export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_darwin_x86_64.tgz" else @@ -19,6 +20,9 @@ fi mkdir -p "$PLUGIN_DATA_ROOT" rm -rf "${PLUGIN_DATA_ROOT:?}"/* +mkdir -p "$PLUGIN_CONFIG_ROOT" +rm -rf "${PLUGIN_CONFIG_ROOT:?}"/* + flunk() { { if [ "$#" -eq 0 ]; then cat - else echo "$*"