Allow mkdwarfs arguments with appdwarf

This commit is contained in:
Phantop 2021-07-09 23:40:58 -04:00
parent 20482c9547
commit 7504c777a7
2 changed files with 6 additions and 7 deletions

View file

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
HERE=$(dirname $(readlink -f "${0}")) HERE=$(dirname $(readlink -f "${0}"))
export LD_LIBRARY_PATH="${HERE}":$PATH export LD_LIBRARY_PATH="${HERE}":$PATH
export DXVK_STATE_CACHE_PATH=~/.cache DXVK_LOG_PATH=none
wine "${HERE}"/Pine.exe $@ wine "${HERE}"/Pine.exe $@

View file

@ -11,7 +11,7 @@ usage(){
} }
dwarf() { dwarf() {
mkdwarfs -i "$1" -o "$(basename "$1").sh" --header <(cat << 'EOF' mkdwarfs -i "$1" -o "$(basename "$1").sh" "${@:2}" --header <(cat << 'EOF'
#!/bin/sh #!/bin/sh
DIR=/tmp/.dwarf_$(basename "$0")$RANDOM DIR=/tmp/.dwarf_$(basename "$0")$RANDOM
mkdir "$DIR" 2> /dev/null mkdir "$DIR" 2> /dev/null
@ -23,7 +23,7 @@ exit
EOF EOF
) )
chmod +x "$(basename "$@").sh" chmod +x "$(basename "$1").sh"
} }
appimage() { appimage() {
@ -32,7 +32,7 @@ appimage() {
chmod +x "$1" chmod +x "$1"
rm -rf squashfs-root rm -rf squashfs-root
./"$1" --appimage-extract || exit 1 ./"$1" --appimage-extract || exit 1
dwarf squashfs-root dwarf squashfs-root "${@:2}"
rm -rf squashfs-root rm -rf squashfs-root
mv squashfs-root.sh "$(basename "$1" .AppImage)".sh mv squashfs-root.sh "$(basename "$1" .AppImage)".sh
else else
@ -54,13 +54,13 @@ do
exit 0 exit 0
;; ;;
--appimage | -a) --appimage | -a)
appimage "$2" appimage "${@:2}"
exit 0 exit 0
;; ;;
--url | -u) --url | -u)
file=$(basename "$2") file=$(basename "$2")
wget "$2" -O "$file" || exit 1 wget "$2" -O "$file" || exit 1
appimage "$file" appimage "$file" "${@:3}"
rm "$file" rm "$file"
exit 0 exit 0
;; ;;
@ -75,6 +75,6 @@ if test $# -eq 0; then
usage usage
exit 0 exit 0
else else
dwarf "$1" dwarf "$@"
exit 0 exit 0
fi fi