use declare for description variable
This commit is contained in:
@@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
config_docker_args() {
|
||||
local desc="config docker-args plugin trigger"
|
||||
declare desc="config docker-args plugin trigger"
|
||||
local trigger="$0 config_docker_args"
|
||||
local STDIN=$(cat); local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE"
|
||||
|
||||
@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
config_export() {
|
||||
local desc="returns export command for config variable of specified type (app/global)"
|
||||
declare desc="returns export command for config variable of specified type (app/global)"
|
||||
local CONFIG_TYPE="$1"
|
||||
local APP="$2"
|
||||
local ENV_FILE="$DOKKU_ROOT/$APP/ENV"
|
||||
@@ -18,7 +18,7 @@ config_export() {
|
||||
}
|
||||
|
||||
config_parse_args() {
|
||||
local desc="parse config plugin args"
|
||||
declare desc="parse config plugin args"
|
||||
unset APP ENV_FILE DOKKU_CONFIG_TYPE DOKKU_CONFIG_RESTART
|
||||
case "$2" in
|
||||
--global)
|
||||
@@ -50,13 +50,13 @@ config_parse_args() {
|
||||
}
|
||||
|
||||
config_create () {
|
||||
local desc="create config env file"
|
||||
declare desc="create config env file"
|
||||
local ENV_FILE=$1
|
||||
[[ -f $ENV_FILE ]] || touch "$ENV_FILE"
|
||||
}
|
||||
|
||||
config_styled_hash () {
|
||||
local desc="internal config hash"
|
||||
declare desc="internal config hash"
|
||||
local vars="$1"
|
||||
local prefix="$2"
|
||||
local longest=""
|
||||
@@ -83,7 +83,7 @@ config_styled_hash () {
|
||||
}
|
||||
|
||||
config_write() {
|
||||
local desc="writes config vars out to appropriate file path"
|
||||
declare desc="writes config vars out to appropriate file path"
|
||||
local ENV_TEMP="$1"
|
||||
local ENV_FILE_TEMP="${ENV_FILE}.tmp"
|
||||
|
||||
@@ -96,7 +96,7 @@ config_write() {
|
||||
}
|
||||
|
||||
is_config_export() {
|
||||
local desc="return 0 if we're supposed to export"
|
||||
declare desc="return 0 if we're supposed to export"
|
||||
for var in "$@"; do
|
||||
if [[ "$var" == "--export" ]]; then
|
||||
return 0
|
||||
@@ -106,7 +106,7 @@ is_config_export() {
|
||||
}
|
||||
|
||||
config_all() {
|
||||
local desc="print or export config vars"
|
||||
declare desc="print or export config vars"
|
||||
[[ "$1" == "config" ]] || set -- "config" "$@"
|
||||
config_parse_args "$@"
|
||||
|
||||
@@ -130,7 +130,7 @@ config_all() {
|
||||
}
|
||||
|
||||
config_get() {
|
||||
local desc="get value of given config var"
|
||||
declare desc="get value of given config var"
|
||||
[[ "$1" == "config:get" ]] || set -- "config:get" "$@"
|
||||
config_parse_args "$@"
|
||||
|
||||
@@ -151,7 +151,7 @@ config_get() {
|
||||
}
|
||||
|
||||
config_set() {
|
||||
local desc="set value of given config var"
|
||||
declare desc="set value of given config var"
|
||||
[[ "$1" == "config:set" ]] || set -- "config:set" "$@"
|
||||
config_parse_args "$@"
|
||||
[[ "$2" = "--no-restart" ]] && set -- "${@:1:1}" "${@:3}"
|
||||
@@ -209,7 +209,7 @@ ${var}"
|
||||
}
|
||||
|
||||
config_unset() {
|
||||
local desc="unset given config var"
|
||||
declare desc="unset given config var"
|
||||
[[ "$1" == "config:unset" ]] || set -- "config:unset" "$@"
|
||||
config_parse_args "$@"
|
||||
[[ "$2" = "--no-restart" ]] && set -- "${@:1:1}" "${@:3}"
|
||||
|
||||
@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
config_main_cmd() {
|
||||
local desc="print config vars for app via command line"
|
||||
declare desc="print config vars for app via command line"
|
||||
local cmd="config"
|
||||
config_all "$@"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
config_get_cmd() {
|
||||
local desc="get specified config vars from app via command line"
|
||||
declare desc="get specified config vars from app via command line"
|
||||
local cmd="config:get"
|
||||
config_get "$@"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
config_set_cmd() {
|
||||
local desc="set specified config vars for app via command line"
|
||||
declare desc="set specified config vars for app via command line"
|
||||
local cmd="config:set"
|
||||
config_set "$@"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
config_unset_cmd() {
|
||||
local desc="unset specified config vars for app via command line"
|
||||
declare desc="unset specified config vars for app via command line"
|
||||
local cmd="config:unset"
|
||||
config_unset "$@"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user