From 158a72e2191a0d39fef2f57ff4c53dff92debed7 Mon Sep 17 00:00:00 2001 From: JeelyWu <127880572+JeelyWu@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:27:32 +0800 Subject: [PATCH] fix(install): prevent unbound variable error on EXIT trap When install.sh is piped to bash (curl | bash), the EXIT trap fires after main() returns. Since tmpdir was declared local, it was destroyed when main() exited, causing 'tmpdir: unbound variable' under set -u. The binary installed successfully, but the script exited with code 1. Fix by making tmpdir a global variable so the trap can reference it after main() returns. --- scripts/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index e9eb3d0..a2218dc 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -113,7 +113,8 @@ main() { local checksum_name local release_base local install_dir - local tmpdir + # tmpdir is intentionally not local so the EXIT trap can reference it after main returns. + tmpdir="" local archive_path local checksum_path local checksum_entry