From db9ca7857e66d0b0794157372d262a5c6b367515 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Wed, 28 Jul 2021 23:33:13 -0400 Subject: [PATCH] Chk all pkgs before init exit. Hide whereis output --- init | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/init b/init index 25422c7..6f70242 100755 --- a/init +++ b/init @@ -2,18 +2,24 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" NEEDS="needs to be installed through your distro's package manager" -if ! whereis python3 | grep "/"; then +failed=false + +if ! whereis python3 | grep "/" &> /dev/null; then echo "python3" $NEEDS - exit 1 + failed=true fi -if ! whereis pip3 | grep "/"; then +if ! whereis pip3 | grep "/" &> /dev/null; then echo "pip3" $NEEDS - exit 1 + failed=true fi -if ! whereis pdflatex | grep "/"; then +if ! whereis pdflatex | grep "/" &> /dev/null; then echo "texlive" $NEEDS + failed=true +fi + +if $failed; then exit 1 fi