aboutsummaryrefslogtreecommitdiff
path: root/.scripts/compile
diff options
context:
space:
mode:
authorMarvin Borner2020-06-11 14:53:23 +0200
committerMarvin Borner2020-06-11 14:53:23 +0200
commitcfc61f4fa5a5b2236439ec1ebe416f23e31d8092 (patch)
tree96f4fd5f4d57e6835dd6f105caca30c65d7160e5 /.scripts/compile
parentd05b17617eb83377f980c24f29079229697504cc (diff)
Soo many features added
weeee so much efficiencyyyy
Diffstat (limited to '.scripts/compile')
-rwxr-xr-x.scripts/compile18
1 files changed, 18 insertions, 0 deletions
diff --git a/.scripts/compile b/.scripts/compile
new file mode 100755
index 0000000..41dd951
--- /dev/null
+++ b/.scripts/compile
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+
+file=$(readlink -f "$1")
+base="${file%.*}"
+ext="${file##*.}"
+
+case "$ext" in
+ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf >"$base".pdf ;;
+[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf >"$base".pdf ;;
+md) lowdown -d nointem -e super "$file" -Tms | groff -T pdf -ms -kept >"$base".pdf ;;
+h) sudo make install ;;
+c) cc "$file" -o "$base" && "$base" ;;
+py) python "$file" ;;
+rs) cargo build ;;
+go) go run "$file" ;;
+sent) setsid -f sent "$file" 2>/dev/null ;;
+*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
+esac