appdwarf/header
Phantop 3ebee5f254 appdwarf: Switch to AppImage standard environmental variables as v3.0
Deprecates $APPDWARF_CMD for $ARGV0, as part of the standard
Also finally removes the separate header, as it seems to
not be needed anymore
2022-06-11 15:05:58 -04:00

18 lines
468 B
Bash
Executable file

#!/bin/sh
# shellcheck disable=SC2086,SC2155
export APPDIR="/tmp/dwarf_$(basename "$0")$(echo "$0" | md5sum | head -c5)"
export APPIMAGE="$0"
export ARGV0="$(basename "$0")"
export OWD="$PWD"
export APPDWARF_CMD="$(basename "$0")"
if [ ! -d "$APPDIR" ]; then
mkdir "$APPDIR"
ARG="-o offset=auto -o tidy_strategy=swap -o workers=4"
dwarfs $ARG "$0" "$APPDIR" 2>/dev/null
fi
"$APPDIR/AppRun" "$@"
fusermount -quz "$APPDIR"
rmdir "$APPDIR" 2> /dev/null
exit