Chk all pkgs before init exit. Hide whereis output

This commit is contained in:
Sage Vaillancourt 2021-07-28 23:33:13 -04:00
parent 8307f654c0
commit db9ca7857e
1 changed files with 11 additions and 5 deletions

16
init
View File

@ -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