From 597d43ec3cc4e5e3f9ce4bdccd8179b79782d06d Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Wed, 28 May 2025 17:13:46 -0600 Subject: [PATCH] Refactor secret generation script to improve variable management - Moved the declaration of the generated_values associative array to a more appropriate location in 03_generate_secrets.sh for better organization. - Removed redundant declaration of generated_values to streamline the script's logic and enhance readability. --- scripts/03_generate_secrets.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/03_generate_secrets.sh b/scripts/03_generate_secrets.sh index fcea10f..215e344 100755 --- a/scripts/03_generate_secrets.sh +++ b/scripts/03_generate_secrets.sh @@ -53,6 +53,7 @@ declare -A VARS_TO_GENERATE=( # Initialize existing_env_vars and attempt to read .env if it exists log_info "Initializing environment configuration..." declare -A existing_env_vars +declare -A generated_values if [ -f "$OUTPUT_FILE" ]; then log_info "Found existing $OUTPUT_FILE. Reading its values to use as defaults and preserve current settings." @@ -325,9 +326,6 @@ if [ ! -f "$TEMPLATE_FILE" ]; then exit 1 fi -# Associative array to store generated values -declare -A generated_values - # Pre-populate generated_values with non-empty values from existing_env_vars for key_from_existing in "${!existing_env_vars[@]}"; do if [[ -n "${existing_env_vars[$key_from_existing]}" ]]; then