From 6566be04e54d798401c835cd0734f43ebfafe72a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 20 Aug 2015 21:28:50 -0400 Subject: [PATCH] Do not exit 1 when there is no env file and the --export flag is in use --- plugins/config/commands | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/config/commands b/plugins/config/commands index f658715fa..fbb59e99f 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -76,12 +76,22 @@ parse_config_args() { export APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART } +is_config_export() { + for var in "$@"; do + if [[ "$var" == "--export" ]]; then + return 0 + fi + done + return 1 +} + case "$1" in config) parse_config_args "$@" config_create [[ "$APP" ]] && DOKKU_CONFIG_TYPE=$APP + [[ ! -s $ENV_FILE ]] && is_config_export $@ && exit 0 [[ ! -s $ENV_FILE ]] && echo "no config vars for $DOKKU_CONFIG_TYPE" && exit 1 VARS=$(grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" $ENV_FILE | cut -d" " -f2-)