Print errors with [x] rather than [-]

This commit is contained in:
0x1eef 2024-05-11 18:52:45 -03:00
parent 9a1826ff87
commit c0dc4c3a44
5 changed files with 10 additions and 10 deletions

View file

@ -10,7 +10,7 @@ doas="${localbase}"/etc/doas.conf
##
# main
if [ "$(id -u)" != "0" ]; then
echo "[-] This command must be run by root"
echo "[x] This command must be run by root"
exit 1
fi

View file

@ -17,7 +17,7 @@ require_dependency() {
deps=$1
for dep in $deps; do
if ! which -s "$dep"; then
echo "[-] This command requires ${dep}, but ${dep} wasn't found"
echo "[x] This command requires ${dep}, but ${dep} wasn't found"
exit 1
fi
done

View file

@ -22,13 +22,13 @@ gitexec()
##
# main
if ! "${libexec}"/issrczap-member; then
echo "[-] This command must be run by a member of the '_srczap' group"
echo "[x] This command must be run by a member of the '_srczap' group"
exit 1
fi
if [ -e "${gitdir}/.git" ]; then
echo "[-] ${gitdir} exists."
echo "[-] Try 'srczap pull'"
echo "[x] ${gitdir} exists."
echo "[x] Try 'srczap pull'"
exit 1
fi

View file

@ -26,7 +26,7 @@ while true; do
printf "[-] Nothing to do\n"
exit
else
printf "[-] '%s' is not a valid option.\n" "${r}"
printf "[x] '%s' is not a valid option.\n" "${r}"
printf "[y|n] "
fi
done

View file

@ -28,7 +28,7 @@ change_branch()
if ! gitexec "checkout ${branch} > /dev/null 2>&1" ||
gitexec "checkout -t ${remote}/${branch} > /dev/null 2>&1"; then
r="${?}"
echo "[-] 'git checkout' exited with an error"
echo "[x] 'git checkout' exited with an error"
exit "${r}"
else
echo "[-] Done"
@ -39,14 +39,14 @@ change_branch()
##
# main
if ! "${libexec}"/issrczap-member; then
echo "[-] This command must be run by a member of the '_srczap' group"
echo "[x] This command must be run by a member of the '_srczap' group"
exit 1
fi
if [ ! -e "${gitdir}/.git" ]; then
set +x
echo "[-] ${gitdir} is not a valid git repository."
echo "[-] Try 'srczap clone'"
echo "[x] ${gitdir} is not a valid git repository."
echo "[x] Try 'srczap clone'"
exit 1
fi