Fix shellcheck errors

This commit is contained in:
0x1eef 2024-04-19 04:45:11 -03:00
parent 4aaa685b3d
commit 049f1a5255
3 changed files with 6 additions and 4 deletions

View file

@ -43,13 +43,16 @@ require_dependency() {
i=1 i=1
while [ "${i}" -le "$#" ]; do while [ "${i}" -le "$#" ]; do
eval "_portzap_option=\$${i}" eval "_portzap_option=\$${i}"
# shellcheck disable=SC2154
if [ "${_portzap_option}" = "-v" ]; then if [ "${_portzap_option}" = "-v" ]; then
echo $(cat "${rootdir}"/../share/portzap/VERSION) cat "${rootdir}"/../share/portzap/VERSION
exit 0 exit 0
fi fi
# shellcheck disable=SC2003
i=$(expr "${i}" + 1); i=$(expr "${i}" + 1);
done done
case $1 in case $1 in
"clone") "clone")
require_dependency "git doas" require_dependency "git doas"

View file

@ -5,7 +5,7 @@
gitdir=$1 gitdir=$1
installdir=$2 installdir=$2
revfile=$3 revfile=$3
libexec=$(dirname $0) libexec=$(dirname "$0")
## ##
# functions # functions

View file

@ -5,7 +5,6 @@
git=/usr/local/bin/git git=/usr/local/bin/git
gitdir=$1 gitdir=$1
branch=$2 branch=$2
libexec=$(dirname "$0")
## ##
# functions # functions
@ -37,7 +36,7 @@ if [ -e "${gitdir}/.git" ]; then
set_repository_permissions "${gitdir}" set_repository_permissions "${gitdir}"
cd "${gitdir}" cd "${gitdir}"
remote=$("${git}" remote | head -n1) remote=$("${git}" remote | head -n1)
if [ $(git branch --show-current) != "${branch}" ]; then if [ "$(git branch --show-current)" != "${branch}" ]; then
change_branch "${remote}" "${branch}" change_branch "${remote}" "${branch}"
fi fi
set -x set -x