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 )"
|
||||
NEEDS="needs to be installed through your distro's package manager"
|
||||
|
||||
function fail {
|
||||
echo "UnderCover Init Failed!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
failed=false
|
||||
|
||||
if ! whereis python3 | grep "/" &> /dev/null; then
|
||||
|
@ -20,7 +25,7 @@ if ! whereis pdflatex | grep "/" &> /dev/null; then
|
|||
fi
|
||||
|
||||
if $failed; then
|
||||
exit 1
|
||||
fail
|
||||
fi
|
||||
|
||||
commands=(
|
||||
|
@ -31,8 +36,7 @@ commands=(
|
|||
|
||||
for com in "${commands[@]}"; do
|
||||
if ! $com; then
|
||||
echo "UnderCover Init Failed!"
|
||||
exit 1
|
||||
fail
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue