From fb96bc2bc346acb2638ea1738f6555886ac475e4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 10 Sep 2025 14:19:12 +0200 Subject: [PATCH] Fix python-dotenv error https://github.com/alexbelgium/hassio-addons/issues/1998#issuecomment-3274113878 --- .templates/00-global_var.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.templates/00-global_var.sh b/.templates/00-global_var.sh index f2b38e29e..bfa2af610 100755 --- a/.templates/00-global_var.sh +++ b/.templates/00-global_var.sh @@ -54,8 +54,13 @@ for KEYS in "${arr[@]}"; do else # Sanitize variable VALUE=$(sanitize_variable "$VALUE") - # Continue for single values - line="${KEYS}='${VALUE//\'/\'\\\'\'}'" + # If value is empty, returns an empty value + if [[ -z "$VALUE" ]]; then + line="${KEYS}=''" + else + # Continue for single values + line="${KEYS}='${VALUE//\'/\'\\\'\'}'" + fi # Check if secret if [[ "${line}" == *"!secret "* ]]; then echo "secret detected"