mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-22 20:07:18 +00:00
Autodetect dwarfs files and write header
This commit is contained in:
parent
ac27ba5a32
commit
84407118fc
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
squashfs-root
|
||||
*.sh
|
||||
*.AppImage
|
17
appdwarf
17
appdwarf
|
@ -62,7 +62,7 @@ case "$1" in
|
|||
shift
|
||||
zzexe "$@" ;;
|
||||
--version | -v )
|
||||
tput setaf 2; echo appdwarf 2022.07.13
|
||||
tput setaf 2; echo appdwarf 2022.07.18
|
||||
tput setaf 6; echo Built by July 🏳️🌈; exit ;;
|
||||
-* | '' )
|
||||
tput setaf 2
|
||||
|
@ -114,14 +114,19 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage
|
|||
chmod +x "$1"
|
||||
rm -rf squashfs-root
|
||||
|
||||
if ! "$(realpath "$1")" --appimage-extract 2> /dev/null; then
|
||||
# this is a file, but it might be an existing dwarfs image
|
||||
if dwarfsck -d0 -i"$1" 2> /dev/null; then
|
||||
set -- "$@" --recompress=none
|
||||
elif "$(realpath "$1")" --appimage-extract 2> /dev/null; then
|
||||
app="$(basename "$1" .AppImage)"
|
||||
rm -rf "$1" "$app"
|
||||
shift
|
||||
set -- "$app" "$@"
|
||||
mv squashfs-root "$1"
|
||||
else
|
||||
tput setaf 4; echo "$1 is not an AppImage, it will be zzexe'd"
|
||||
zzexe "$@"
|
||||
fi
|
||||
|
||||
app="$(basename "$1" .AppImage)" shift
|
||||
set -- "$app" "$@"
|
||||
mv squashfs-root "$1"
|
||||
fi
|
||||
|
||||
head="$(mktemp)"
|
||||
|
|
|
@ -4,7 +4,7 @@ DIR=/tmp/appdwarf/$APP
|
|||
mkdir -p "$DIR"
|
||||
VER=Kron4ek/Wine-Builds
|
||||
[ "$1" = "proton" ] && VER=GloriousEggroll/proton-ge-custom && shift
|
||||
LINK=$(curl -L api.github.com/repos/$VER/releases | jq .[0].assets[1] | grep -om1 g.\*tar..z)
|
||||
LINK=$(curl -L api.github.com/repos/$VER/releases | jq .[0].assets[1] | grep -om1 git.\*tar..z)
|
||||
curl -L "$LINK" | bsdtar xf - -C"$DIR"
|
||||
mv "$DIR"/wine*/* "$DIR"/GE-Proton*/files/* "$DIR"
|
||||
t=winetricks; wget -O"$DIR"/bin/$t github.com/$t/$t/raw/master/src/$t
|
||||
|
|
Loading…
Reference in a new issue