From c1a76f5f88ba03367753d5defec82f0f12364989 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 20 Apr 2024 00:30:24 -0300 Subject: [PATCH] Fix bug caught by shellcheck --- libexec/portzap/portzap-clone | 3 ++- libexec/portzap/portzap-pull | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/portzap/portzap-clone b/libexec/portzap/portzap-clone index 6d1dc24..ffe982b 100755 --- a/libexec/portzap/portzap-clone +++ b/libexec/portzap/portzap-clone @@ -33,8 +33,9 @@ if ! doas -u _portzap "${git}" \ checkout -t \ origin/"${branch}" \ > /dev/null 2>&1; then + r="${?}" echo "[-] 'git checkout' exited with an error" - exit "${?}" + exit "${r}" else echo "[-] Done" fi diff --git a/libexec/portzap/portzap-pull b/libexec/portzap/portzap-pull index 6438c94..1d35ce0 100755 --- a/libexec/portzap/portzap-pull +++ b/libexec/portzap/portzap-pull @@ -21,8 +21,9 @@ change_branch() doas -u _portzap "${git}" fetch "${remote}" > /dev/null 2>&1 if ! doas -u _portzap "${git}" checkout "${branch}" > /dev/null 2>&1 || doas -u _portzap "${git}" checkout -t "${remote}"/"${branch}" > /dev/null 2>&1; then + r="${?}" echo "[-] 'git checkout' exited with an error" - exit "${?}" + exit "${r}" else echo "[-] Done" fi