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