appdwarf/apps/appmk

43 lines
645 B
Plaintext
Raw Normal View History

2022-10-18 14:09:41 +00:00
#!/bin/sh
set -e # exit on failure
IFS=$(printf '\n\t') # smarter ifs
trap 'rm -rf "$DIR"' 0 1 2 3 6 14 15 EXIT
part0() { # dir setup
APP=$(basename "$0" | sed 's/^mk//')
DIR=/tmp/appdwarf/$APP
mkdir -p "$DIR"
}
ungz() { # default decomps
curl -L "$LINK" | tar xz -C"$DIR"
}
unbz() {
curl -L "$LINK" | tar xj -C"$DIR"
}
unxz() {
curl -L "$LINK" | tar xJ -C"$DIR"
}
unarc() {
curl -L "$LINK" | bsdtar xf - -C"$DIR"
}
appa() { # default appruns
appdwarf -a "$DIR"/AppRun
}
appb() {
appdwarf -b "$DIR"/AppRun
}
part9() { # ending bit
appdwarf "$DIR"
mv "$DIR".sh bin/"$APP"
rm -rf "$DIR"
}