Fix bug caught by shellcheck

This commit is contained in:
0x1eef 2024-04-20 00:30:24 -03:00
parent 5b363c9eac
commit c1a76f5f88
2 changed files with 4 additions and 2 deletions

View file

@ -33,8 +33,9 @@ if ! doas -u _portzap "${git}" \
checkout -t \ checkout -t \
origin/"${branch}" \ origin/"${branch}" \
> /dev/null 2>&1; then > /dev/null 2>&1; then
r="${?}"
echo "[-] 'git checkout' exited with an error" echo "[-] 'git checkout' exited with an error"
exit "${?}" exit "${r}"
else else
echo "[-] Done" echo "[-] Done"
fi fi

View file

@ -21,8 +21,9 @@ change_branch()
doas -u _portzap "${git}" fetch "${remote}" > /dev/null 2>&1 doas -u _portzap "${git}" fetch "${remote}" > /dev/null 2>&1
if ! doas -u _portzap "${git}" checkout "${branch}" > /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 doas -u _portzap "${git}" checkout -t "${remote}"/"${branch}" > /dev/null 2>&1; then
r="${?}"
echo "[-] 'git checkout' exited with an error" echo "[-] 'git checkout' exited with an error"
exit "${?}" exit "${r}"
else else
echo "[-] Done" echo "[-] Done"
fi fi