mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 14:23:08 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user