From cd9dc925f386f0702d726cabd245902108a05b26 Mon Sep 17 00:00:00 2001 From: Kelin Date: Mon, 2 Feb 2026 13:56:27 -0500 Subject: [PATCH] Add logging of missing variables and trim keys in .env parsing --- scripts/ez-homelab.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/ez-homelab.sh b/scripts/ez-homelab.sh index 22f7267..eed9978 100755 --- a/scripts/ez-homelab.sh +++ b/scripts/ez-homelab.sh @@ -77,14 +77,8 @@ load_env_file_safely() { local key="${BASH_REMATCH[1]}" local value="${BASH_REMATCH[2]}" - # Remove surrounding quotes if present - if [[ $value =~ ^\'(.*)\'$ ]]; then - value="${BASH_REMATCH[1]}" - elif [[ $value =~ ^\"(.*)\"$ ]]; then - value="${BASH_REMATCH[1]}" - fi - - # Trim whitespace from value + # Trim whitespace from key and value + key=$(echo "$key" | xargs) value=$(echo "$value" | xargs) debug_log "Exported $key=[HIDDEN]" # Don't log actual values for security fi @@ -619,6 +613,7 @@ validate_and_prompt_variables() { esac else echo "" + echo "Missing variables: ${missing_vars[*]}" echo "Some variables need configuration. Press Enter to continue or 'q' to quit." read -p "Press Enter to configure missing variables, or 'q' to quit: " user_choice