From 52cb45847a8d82f522645ca5f97db5b9082ac8d6 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 28 Jul 2021 23:36:22 -0400 Subject: [PATCH] Add fail() to init --- init | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init b/init index 6f70242..e9bcca2 100755 --- a/init +++ b/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