summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-06-09 16:42:42 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-06-09 16:42:42 -0400
commit117194dc6f6c1e0033f17113732bdb6139be5d9e (patch)
tree2f96ef8a54de27fcd8843ce7539a7a157b07f883 /.local/bin
parent3f5d9da47569b1af2fa4c7e2be70e1eeff9a2ed2 (diff)
parentb1d1446325fe483be0078c8932f5eb99fd98ea2b (diff)
downloadeibhear-117194dc6f6c1e0033f17113732bdb6139be5d9e.tar.gz
eibhear-117194dc6f6c1e0033f17113732bdb6139be5d9e.tar.zst
eibhear-117194dc6f6c1e0033f17113732bdb6139be5d9e.zip
Merge branch 'master' of github.com:LukeSmithxyz/voidrice
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/compiler30
1 files changed, 16 insertions, 14 deletions
diff --git a/.local/bin/compiler b/.local/bin/compiler
index f28ffe1..58a809f 100755
--- a/.local/bin/compiler
+++ b/.local/bin/compiler
@@ -12,6 +12,7 @@
file=$(readlink -f "$1")
dir=${file%/*}
base="${file%.*}"
+ext="${file##*.}"
cd "$dir" || exit
@@ -25,25 +26,26 @@ textype() { \
$command --output-directory="$dir" "$base"
}
-case "$file" in
- *\.ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;;
- *\.mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;;
- *\.[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
- *\.[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
- *\.tex) textype "$file" ;;
- *\.md) if command -v lowdown >/dev/null; then
+case "$ext" in
+ ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;;
+ mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;;
+ [0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
+ [rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
+ tex) textype "$file" ;;
+ md) if command -v lowdown >/dev/null; then
lowdown -d nointem -e super "$file" -Tms | groff -mpdfmark -ms -kept > "$base".pdf
elif command -v groffdown >/dev/null; then
groffdown -i "$file" | groff > "$base.pdf"
else
pandoc "$file" --pdf-engine=xelatex -o "$base".pdf
fi ; ;;
- *config.h) sudo make install ;;
- *\.c) cc "$file" -o "$base" && "$base" ;;
- *\.py) python "$file" ;;
- *\.m) octave "$file" ;;
- *\.scad) openscad -o "$base".stl "$file" ;;
- *\.go) go run "$file" ;;
- *\.sent) setsid -f sent "$file" 2>/dev/null ;;
+ h) sudo make install ;;
+ c) cc "$file" -o "$base" && "$base" ;;
+ py) python "$file" ;;
+ rs) cargo build ;;
+ m) octave "$file" ;;
+ scad) openscad -o "$base".stl "$file" ;;
+ go) go run "$file" ;;
+ sent) setsid -f sent "$file" 2>/dev/null ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac