From 4246954ac553ee50fc383dd4c7632dd59f1ce791 Mon Sep 17 00:00:00 2001 From: swytch Date: Sun, 14 Jun 2020 16:46:02 +0200 Subject: [PATCH] fix: fix `compiler` fix bibliography retrieving fix suckless tools build -> exit 1 when not building from config.def.h -> exit 0 when building (not break 0) --- .local/bin/compiler | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index eefd400..3237880 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -32,7 +32,7 @@ shebangtest() } texcompile() { \ - bibliography="$(grep '\bibliography' "$file")" + bibliography="$(grep '\\bibliography' "$file")" if [ -n "$bibliography" ]; then pdflatex --output-directory="$dir" "$base" && bibtex "$base" && @@ -47,16 +47,15 @@ texcompile() { \ s_build(){ case "$file" in *config.def.h) sudo make clean install && rm -f config.h ;; - *config.h) printf "\nYou should build from config.def.h !" ;; + *config.h) printf "\nYou should build from config.def.h !" && exit 1 ;; + *) printf "\nI guess you lost yourself ? Please build from config.def.h !" && exit 1 ;; esac - - exit 0 } for tool in $sucklesstools; do if [ "$tool" = "$dirname" ]; then s_build - break 0 + exit 0 fi done