From 049f1a525515e25e77e4d1011cf458b06ad17557 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 19 Apr 2024 04:45:11 -0300 Subject: [PATCH] Fix shellcheck errors --- bin/portzap | 5 ++++- libexec/portzap/portzap-install | 2 +- libexec/portzap/portzap-pull | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/portzap b/bin/portzap index 2f45f37..3925151 100755 --- a/bin/portzap +++ b/bin/portzap @@ -43,13 +43,16 @@ require_dependency() { i=1 while [ "${i}" -le "$#" ]; do eval "_portzap_option=\$${i}" + # shellcheck disable=SC2154 if [ "${_portzap_option}" = "-v" ]; then - echo $(cat "${rootdir}"/../share/portzap/VERSION) + cat "${rootdir}"/../share/portzap/VERSION exit 0 fi + # shellcheck disable=SC2003 i=$(expr "${i}" + 1); done + case $1 in "clone") require_dependency "git doas" diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index f3bf241..d39b0fe 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -5,7 +5,7 @@ gitdir=$1 installdir=$2 revfile=$3 -libexec=$(dirname $0) +libexec=$(dirname "$0") ## # functions diff --git a/libexec/portzap/portzap-pull b/libexec/portzap/portzap-pull index bf68249..34d1c3e 100755 --- a/libexec/portzap/portzap-pull +++ b/libexec/portzap/portzap-pull @@ -5,7 +5,6 @@ git=/usr/local/bin/git gitdir=$1 branch=$2 -libexec=$(dirname "$0") ## # functions @@ -37,7 +36,7 @@ if [ -e "${gitdir}/.git" ]; then set_repository_permissions "${gitdir}" cd "${gitdir}" remote=$("${git}" remote | head -n1) - if [ $(git branch --show-current) != "${branch}" ]; then + if [ "$(git branch --show-current)" != "${branch}" ]; then change_branch "${remote}" "${branch}" fi set -x