From 9ae9a0f3dc1a568d87809eb9c25bf7483f36835d Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:32:28 +0100 Subject: [PATCH] fix: prevent install.sh crash when .env exists without expected keys The env_val() function uses grep which returns exit code 1 when no match is found. Under set -euo pipefail, this kills the script. Adding || true prevents this on upgrade installs with older .env files. --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7c61486f..9e38ad79 100755 --- a/install.sh +++ b/install.sh @@ -141,10 +141,11 @@ if [[ -f .env ]]; then info "Existing .env detected — secrets will be preserved." fi -# Helper: read existing .env value +# Helper: read existing .env value (|| true prevents set -e from killing +# the script when grep finds no match and returns exit code 1) env_val() { if [[ -f .env ]]; then - grep "^${1}=" .env 2>/dev/null | head -1 | cut -d= -f2- + grep "^${1}=" .env 2>/dev/null | head -1 | cut -d= -f2- || true fi }