From fd15c183895791d7e976460ca52e1c3eb70d45b1 Mon Sep 17 00:00:00 2001 From: Kelin Date: Mon, 2 Feb 2026 14:48:28 -0500 Subject: [PATCH] Strip carriage returns from .env values to handle DOS line endings --- scripts/ez-homelab.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/ez-homelab.sh b/scripts/ez-homelab.sh index 6f18e0c..c06d80b 100755 --- a/scripts/ez-homelab.sh +++ b/scripts/ez-homelab.sh @@ -84,6 +84,9 @@ load_env_file_safely() { key=$(echo "$key" | xargs) value=$(echo "$value" | xargs) + # Strip carriage return if present (DOS line endings) + value=${value%$'\r'} + # Export the variable export "$key"="$value" @@ -128,6 +131,7 @@ localize_yml_file() { # Use envsubst to replace all ${VAR} with environment values if command -v envsubst >/dev/null 2>&1; then + log_info "DEBUG: DEFAULT_EMAIL=$DEFAULT_EMAIL" envsubst < "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path" debug_log "Replaced variables in $file_path using envsubst" replaced_count=$(grep -o '\${[^}]*}' "$file_path" | wc -l)