Add fail() to init
This commit is contained in:
parent
db9ca7857e
commit
52cb45847a
10
init
10
init
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue