diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2018-10-26 00:28:09 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2018-10-26 00:28:09 -0400 |
| commit | 171a00523f24c94e650de791194313b8f0cdde03 (patch) | |
| tree | d834994896b2ca136e5e077862ffa592c5483d0e /.scripts/compiler | |
| parent | dafffb1c73226f4d694ca4cb9f677cd37d3536c5 (diff) | |
| download | eibhear-171a00523f24c94e650de791194313b8f0cdde03.tar.gz eibhear-171a00523f24c94e650de791194313b8f0cdde03.tar.zst eibhear-171a00523f24c94e650de791194313b8f0cdde03.zip | |
cleanup
Diffstat (limited to '.scripts/compiler')
| -rwxr-xr-x | .scripts/compiler | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/.scripts/compiler b/.scripts/compiler index 7338d30..765bde4 100755 --- a/.scripts/compiler +++ b/.scripts/compiler @@ -1,33 +1,29 @@ #!/bin/sh # This script will compile or run another finishing operation on a document. I -# have this script run via vim/emacs. +# have this script run via vim. # # tex files: Compiles to pdf, including bibliography if necessary # md files: Compiles to pdf via pandoc # rmd files: Compiles via R Markdown -# c files: Compiles via whatever compiler is set to cc. Usually gcc. +# c files: Compiles via whatever compiler is set to cc. Usually gcc. # py files: runs via python command # go files: compiles and runs with "go run" # config.h files: (For suckless utils) recompiles and installs program. # all others: run `sent` to show a presentation - -oridir=$(pwd) - file=$(readlink -f "$1") dir=$(dirname "$file") base="${file%.*}" -shebang=$(sed -n 1p $file) - -cd $dir +shebang=$(sed -n 1p "$file") +cd "$dir" || exit textype() { \ command="pdflatex" ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" $command --output-directory="$dir" "$base" && - grep -i addbibresource "$file" && + grep -i addbibresource "$file" >/dev/null && biber --input-directory "$dir" "$base" && $command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" @@ -49,11 +45,5 @@ case "$file" in *\.c) cc "$file" -o "$base" && "$base" ;; *\.py) python "$file" ;; *\.go) go run "$file" ;; - - - *) shebangtest ;; - esac -cd $oridir - |
