summaryrefslogtreecommitdiffstats
path: root/.scripts/compiler
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2018-11-05 17:51:24 -0500
committerLuke Smith <luke@lukesmith.xyz>2018-11-05 17:51:24 -0500
commit2f4c2a68a1cbebb0e06a5b3296e4bbb575c5fcb2 (patch)
tree4adda53569104861794d990ef99c85edc1ae2d8c /.scripts/compiler
parentcd667e6aa111c86b40b9e3104605953e9b341332 (diff)
downloadeibhear-2f4c2a68a1cbebb0e06a5b3296e4bbb575c5fcb2.tar.gz
eibhear-2f4c2a68a1cbebb0e06a5b3296e4bbb575c5fcb2.tar.zst
eibhear-2f4c2a68a1cbebb0e06a5b3296e4bbb575c5fcb2.zip
scripts sorted
Diffstat (limited to '.scripts/compiler')
-rwxr-xr-x.scripts/compiler49
1 files changed, 0 insertions, 49 deletions
diff --git a/.scripts/compiler b/.scripts/compiler
deleted file mode 100755
index 53d6768..0000000
--- a/.scripts/compiler
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-# This script will compile or run another finishing operation on a document. I
-# 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.
-# 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
-
-file=$(readlink -f "$1")
-dir=$(dirname "$file")
-base="${file%.*}"
-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" >/dev/null &&
- biber --input-directory "$dir" "$base" &&
- $command --output-directory="$dir" "$base" &&
- $command --output-directory="$dir" "$base"
- }
-
-shebangtest() {
- case "$shebang" in
- \#\!*) "$file" ;;
- *) sent "$file" 2>/dev/null & ;;
- esac
-}
-
-case "$file" in
- *\.ms) refer -PS -e "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;;
- *\.rmd) echo "require(rmarkdown); render('$file')" | R --vanilla ;;
- *\.tex) textype "$file" ;;
- *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
- *config.h) make && sudo make install ;;
- *\.c) cc "$file" -o "$base" && "$base" ;;
- *\.py) python "$file" ;;
- *\.go) go run "$file" ;;
- *) shebangtest ;;
-esac