blob: 41dd951df021c80a9483c686d30a847a3372b17f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
|