Add fail() to init

This commit is contained in:
Sage Vaillancourt 2021-07-28 23:36:22 -04:00
parent db9ca7857e
commit 52cb45847a
1 changed files with 7 additions and 3 deletions

10
init
View File

@ -2,6 +2,11 @@
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
NEEDS="needs to be installed through your distro's package manager" NEEDS="needs to be installed through your distro's package manager"
function fail {
echo "UnderCover Init Failed!"
exit 1
}
failed=false failed=false
if ! whereis python3 | grep "/" &> /dev/null; then if ! whereis python3 | grep "/" &> /dev/null; then
@ -20,7 +25,7 @@ if ! whereis pdflatex | grep "/" &> /dev/null; then
fi fi
if $failed; then if $failed; then
exit 1 fail
fi fi
commands=( commands=(
@ -31,8 +36,7 @@ commands=(
for com in "${commands[@]}"; do for com in "${commands[@]}"; do
if ! $com; then if ! $com; then
echo "UnderCover Init Failed!" fail
exit 1
fi fi
done done