Remove config wrappers.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#
|
||||
# AVAILABLE FUNCTIONS:
|
||||
# - Print functions: print_header, print_info, print_warning, print_success, print_error
|
||||
# - Config functions: get_current_config, get_current_secret, prompt_with_default
|
||||
# - Config functions: prompt_with_default
|
||||
# - Config helpers: prompt_if_unset_config, prompt_if_unset_secret
|
||||
# - Validation: check_wild_directory
|
||||
# - Utilities: command_exists, file_readable, dir_writable, generate_random_string
|
||||
@@ -64,31 +64,7 @@ print_error() {
|
||||
# CONFIGURATION UTILITIES
|
||||
# =============================================================================
|
||||
|
||||
# Function to get current config value safely
|
||||
get_current_config() {
|
||||
local key="$1"
|
||||
if [ -f "${WC_HOME}/config.yaml" ]; then
|
||||
set +e
|
||||
result=$(wild-config "${key}" 2>/dev/null)
|
||||
set -e
|
||||
echo "${result}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to get current secret value safely
|
||||
get_current_secret() {
|
||||
local key="$1"
|
||||
if [ -f "${WC_HOME}/secrets.yaml" ]; then
|
||||
set +e
|
||||
result=$(wild-secret "${key}" 2>/dev/null)
|
||||
set -e
|
||||
echo "${result}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to prompt for input with default value
|
||||
prompt_with_default() {
|
||||
@@ -134,7 +110,7 @@ prompt_if_unset_config() {
|
||||
local default="$3"
|
||||
|
||||
local current_value
|
||||
current_value=$(get_current_config "${config_path}")
|
||||
current_value=$(wild-config "${config_path}")
|
||||
|
||||
if [ -z "${current_value}" ] || [ "${current_value}" = "null" ]; then
|
||||
local new_value
|
||||
@@ -153,7 +129,7 @@ prompt_if_unset_secret() {
|
||||
local default="$3"
|
||||
|
||||
local current_value
|
||||
current_value=$(get_current_secret "${secret_path}")
|
||||
current_value=$(wild-secret "${secret_path}")
|
||||
|
||||
if [ -z "${current_value}" ] || [ "${current_value}" = "null" ]; then
|
||||
local new_value
|
||||
|
Reference in New Issue
Block a user