From f7a86bc35349068941266ab22a0bbdb43fbdb0fc Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 14 Dec 2025 19:08:32 +0100 Subject: [PATCH] fix(launcher): avoid calling missing retry helper in packaged installs - Load GitHub 403 retry helper only when available - Fallback to plain `nix run` if retry function is not defined - Prevent exit 127 when pkgmgr launcher is installed without retry script - Fix E2E failure for `pkgmgr update pkgmgr --system` https://chatgpt.com/share/693efd23-8b60-800f-adbb-9dfffc33f1f7 --- scripts/launcher.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/launcher.sh b/scripts/launcher.sh index 72270cc..7a1ba70 100755 --- a/scripts/launcher.sh +++ b/scripts/launcher.sh @@ -13,9 +13,6 @@ if [[ ! -f "${RETRY_LIB}" ]]; then exit 1 fi -# shellcheck source=./scripts/nix/lib/retry_403.sh -source "${RETRY_LIB}" - # --------------------------------------------------------------------------- # Try to ensure that "nix" is on PATH (common locations + container user) # --------------------------------------------------------------------------- @@ -47,8 +44,12 @@ fi # --------------------------------------------------------------------------- # Primary path: use Nix flake if available (with GitHub 403 retry) # --------------------------------------------------------------------------- -if command -v nix >/dev/null 2>&1; then +if declare -F run_with_github_403_retry >/dev/null; then + # shellcheck source=./scripts/nix/lib/retry_403.sh + source "${RETRY_LIB}" exec run_with_github_403_retry nix run "${FLAKE_DIR}#pkgmgr" -- "$@" +else + exec nix run "${FLAKE_DIR}#pkgmgr" -- "$@" fi echo "[launcher] ERROR: 'nix' binary not found on PATH after init."