Compare commits

..

3 commits

Author SHA1 Message Date
16ca9b6c68 Silence "git checkout" output
Some checks failed
sourcezap / shellcheck (push) Has been cancelled
2024-07-27 06:09:53 -03:00
b8bef1f953 Fix shellcheck errors (includes a bug in setup-user) 2024-07-26 22:36:35 -03:00
c6e83bea5e Inline function in setup-doas 2024-07-26 15:43:56 -03:00
10 changed files with 18 additions and 16 deletions

View file

@ -17,4 +17,4 @@ deinstall:
rm -rf $(SHAREDIR)
shellcheck:
find bin/ libexec/ -type f -exec shellcheck "{}" \;
find bin/ libexec/ -type f -exec shellcheck -x "{}" \;

View file

@ -8,6 +8,7 @@ libexec="${localbase}"/libexec/sourcezap
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
##

View file

@ -13,6 +13,7 @@ revision="${installdir}"/.sourcezap
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
require_dependency()

View file

@ -11,6 +11,7 @@ branch=$2
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
##

View file

@ -12,6 +12,7 @@ branch=$3
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
##
@ -34,5 +35,5 @@ fi
"${git}" clone "${giturl}" "${gitdir}"
cd "${gitdir}"
"${git}" config core.filemode off
"${git}" checkout -t origin/"${branch}" || true
"${git}" checkout -t origin/"${branch}" > /dev/null 2>&1 || true
printok "clone complete"

View file

@ -13,6 +13,7 @@ revfile=$3
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
perform_update()

View file

@ -10,6 +10,7 @@ gitdir=$1
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
##

View file

@ -10,6 +10,7 @@ installdir=$2
##
# functions
# shellcheck source=/dev/null
. "${libexec}"/functions/print.sh
erase()

View file

@ -11,18 +11,13 @@ sharedir="${localbase}"/share/sourcezap
# functions
. "${libexec}"/functions/print.sh
install_doasconf()
{
src="${sharedir}"/doas.conf
dest="${localbase}"/etc/doas.conf
if grep -Fq "$(cat "${src}")" "${dest}"; then
printok "doas.conf is up to date"
else
cat "${src}" >> "${dest}"
printok "${dest} updated"
fi
}
##
# main
install_doasconf
src="${sharedir}"/doas.conf
dest="${localbase}"/etc/doas.conf
if grep -Fq "$(cat "${src}")" "${dest}"; then
printok "doas.conf is up to date"
else
cat "${src}" >> "${dest}"
printok "${dest} updated"
fi

View file

@ -16,7 +16,7 @@ user="_sourcezap"
if id -u "${user}" > /dev/null 2>&1; then
printok "${user} user exists"
else
pw useradd
pw useradd \
-n "${user}" \
-c "sourcezap user" \
-m \