From ba0e00a358ec5e9a70276f570fbde70b292bb9f2 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Mon, 9 Feb 2026 16:21:24 +0800 Subject: [PATCH] Fix agent-install first-run exit under set -e --- scripts/agent-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/agent-install.sh b/scripts/agent-install.sh index 4e72fe2..67f7b57 100755 --- a/scripts/agent-install.sh +++ b/scripts/agent-install.sh @@ -169,7 +169,10 @@ version_from_bin() { local bin="$1" local regex="$2" if [[ ! -x "${bin}" ]]; then - return 1 + # With `set -e`, a non-zero exit inside command substitution would abort the script. + # Missing binaries are expected on first install, so return empty + success. + echo "" + return 0 fi "${bin}" --version 2>/dev/null | grep -Eo "${regex}" | head -n1 || true }