From d7daaaa8b3d31a6e561a3f9dccfa17930424ddbe Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Fri, 21 May 2021 02:00:03 +0200 Subject: [PATCH] fix: `compiler` moving suckless tools to ~/.local/src broke compiler it's simpler to trim it down and remove useless functions --- .local/bin/compiler | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index a46d8d6..322a628 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -10,7 +10,7 @@ # groff-mom : compile via pdfmom to a pdf document # c : compile via gcc # config.def.h (suckless) : recompile, install -# blocks.def.h (dwmblocks) : recompile, install +# blocks.def.h (dwmblocks) : recompile, install # tex : compile via pdflatex (bibtex if needed) ###################################################################### @@ -21,8 +21,6 @@ dirname=$(basename "$dir") base="$(printf "${file%.*}" | awk -F '/' '{printf $NF}')" shebang=$(sed -n 1p "$file") -sucklesstools="$(ls $HOME/.local/src/suckless)" - cd "$dir" || exit shebangtest() @@ -45,14 +43,6 @@ texcompile() { \ fi } -s_build(){ - case "$file" in - *config.def.h) sudo make clean install ;; - *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 -} - for tool in $sucklesstools; do if [ "$tool" = "$dirname" ]; then s_build @@ -61,7 +51,8 @@ for tool in $sucklesstools; do done case "$file" in - *blocks.def.h) make && sudo make clean install ;; + *blocks.def.h) sudo make clean install ;; + *config.def.h) sudo make clean install ;; *.c*|*.h*) make && ./main ;; *.mom) refer -PS -e "$file" | pdfmom > "$base.pdf" ;; *.tex) texcompile "$base" ; texclear "$file" ;;