[config] lint fixes

This commit is contained in:
Alex Quick
2017-02-18 15:56:31 -05:00
parent 73e85b7df5
commit 686428a41a
5 changed files with 22 additions and 17 deletions

View File

@@ -2,39 +2,44 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
config_sub(){
declare desc="executes a config subcommand"
local name="$1"
shift
"$PLUGIN_AVAILABLE_PATH/config/subcommands/$name" "config:$name" "$@"
}
config_export() {
declare desc="returns export command for config variable of specified type (app/global)"
local CONFIG_TYPE="$1"
local APP="$2"
shift
local APP="$1"
if [[ $CONFIG_TYPE == "global" ]]; then
APP="--global"
else
shift
fi
$PLUGIN_AVAILABLE_PATH/config/subcommands/export config:export "$APP"
config_sub export "$@" "$APP"
return 0
}
config_keys() {
declare desc="returns keys for app or global"
local CONFIG_TYPE="$1"
local APP="$2"
if [[ $CONFIG_TYPE == "global" ]]; then
APP="--global"
fi
$PLUGIN_AVAILABLE_PATH/config/subcommands/export config:export --keys "$APP"
config_export "$@" "--keys"
return 0
}
config_get() {
declare desc="get value of given config var"
$PLUGIN_AVAILABLE_PATH/config/subcommands/get config:get "$@"
config_sub get "$@"
}
config_set() {
declare desc="set value of given config var"
$PLUGIN_AVAILABLE_PATH/config/subcommands/set config:set "$@"
config_sub set "$@"
}
config_unset() {
declare desc="set value of given config var"
$PLUGIN_AVAILABLE_PATH/config/subcommands/unset config:unset "$@"
config_sub unset "$@"
}