From eca5d5585d5b6493c2bef9cd5c0be224c3f7eb3c Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 26 Jul 2024 22:26:07 -0300 Subject: [PATCH] Fix shellcheck errors (includes a bug in setup-user) --- Makefile | 2 +- bin/portzap | 1 + bin/setup-portzap | 1 + libexec/portzap/commands/portzap-checkout | 1 + libexec/portzap/commands/portzap-clone | 1 + libexec/portzap/commands/portzap-install | 1 + libexec/portzap/commands/portzap-pull | 1 + libexec/portzap/commands/portzap-rm | 1 + libexec/portzap/setup/setup-doas | 1 + libexec/portzap/setup/setup-user | 3 ++- 10 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2494492..74f23d8 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,4 @@ deinstall: rm -rf $(SHAREDIR) shellcheck: - find bin/ libexec/ -type f -exec shellcheck "{}" \; + find bin/ libexec/ -type f -exec shellcheck -x "{}" \; diff --git a/bin/portzap b/bin/portzap index ab09cce..e68ece3 100755 --- a/bin/portzap +++ b/bin/portzap @@ -13,6 +13,7 @@ revfile="${installdir}"/.portzap ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh require_dependency() diff --git a/bin/setup-portzap b/bin/setup-portzap index f527c9e..8b409c4 100755 --- a/bin/setup-portzap +++ b/bin/setup-portzap @@ -8,6 +8,7 @@ libexec="${localbase}"/libexec/portzap ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## diff --git a/libexec/portzap/commands/portzap-checkout b/libexec/portzap/commands/portzap-checkout index e52c6b6..4604e2e 100644 --- a/libexec/portzap/commands/portzap-checkout +++ b/libexec/portzap/commands/portzap-checkout @@ -11,6 +11,7 @@ branch=$2 ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## diff --git a/libexec/portzap/commands/portzap-clone b/libexec/portzap/commands/portzap-clone index 5e62786..e4a0019 100755 --- a/libexec/portzap/commands/portzap-clone +++ b/libexec/portzap/commands/portzap-clone @@ -12,6 +12,7 @@ branch=$3 ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## diff --git a/libexec/portzap/commands/portzap-install b/libexec/portzap/commands/portzap-install index d4e796d..d251382 100755 --- a/libexec/portzap/commands/portzap-install +++ b/libexec/portzap/commands/portzap-install @@ -13,6 +13,7 @@ revfile=$3 ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh perform_update() diff --git a/libexec/portzap/commands/portzap-pull b/libexec/portzap/commands/portzap-pull index b760c37..44c73f3 100755 --- a/libexec/portzap/commands/portzap-pull +++ b/libexec/portzap/commands/portzap-pull @@ -10,6 +10,7 @@ gitdir=$1 ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## diff --git a/libexec/portzap/commands/portzap-rm b/libexec/portzap/commands/portzap-rm index e5b63a0..d5253cb 100644 --- a/libexec/portzap/commands/portzap-rm +++ b/libexec/portzap/commands/portzap-rm @@ -10,6 +10,7 @@ installdir=$2 ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh erase() diff --git a/libexec/portzap/setup/setup-doas b/libexec/portzap/setup/setup-doas index 0dd0e82..7f4c1e4 100644 --- a/libexec/portzap/setup/setup-doas +++ b/libexec/portzap/setup/setup-doas @@ -9,6 +9,7 @@ sharedir="${localbase}"/share/portzap ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## diff --git a/libexec/portzap/setup/setup-user b/libexec/portzap/setup/setup-user index 05fa94d..b3cf684 100644 --- a/libexec/portzap/setup/setup-user +++ b/libexec/portzap/setup/setup-user @@ -9,6 +9,7 @@ user="_portzap" ## # functions +# shellcheck source=/dev/null . "${libexec}"/functions/print.sh ## @@ -16,7 +17,7 @@ user="_portzap" if id -u "${user}" > /dev/null 2>&1; then printok "${user} user exists" else - pw useradd + pw useradd \ -n "${user}" \ -c "portzap user" \ -m \