mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-10 06:06:47 +00:00
appdwarf: handle appimage architectures better
for real this time
This commit is contained in:
parent
86b2d23257
commit
4dd8196538
6
appdwarf
6
appdwarf
|
@ -71,7 +71,7 @@ case "$1" in
|
||||||
shift
|
shift
|
||||||
zzexe "$@" ;;
|
zzexe "$@" ;;
|
||||||
--version | -v )
|
--version | -v )
|
||||||
tput setaf 2; echo appdwarf 2023.01.09
|
tput setaf 2; echo appdwarf 2023.01.14
|
||||||
tput setaf 6; echo Built by July 🏳️🌈; exit ;;
|
tput setaf 6; echo Built by July 🏳️🌈; exit ;;
|
||||||
-* | '' )
|
-* | '' )
|
||||||
echo "Usage: appdwarf [option] [APP/FILE/FOLDER/URL] [compression options]"
|
echo "Usage: appdwarf [option] [APP/FILE/FOLDER/URL] [compression options]"
|
||||||
|
@ -102,8 +102,10 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage
|
||||||
if echo "$1" | grep -q 'https://github.com/[^/]*/[^/]*/*$'; then # GitHub url
|
if echo "$1" | grep -q 'https://github.com/[^/]*/[^/]*/*$'; then # GitHub url
|
||||||
echo "Assuming this is a GitHub repo..."
|
echo "Assuming this is a GitHub repo..."
|
||||||
app="$(echo "${1%/}"/releases | sed 's|github.com|api.github.com/repos|')"
|
app="$(echo "${1%/}"/releases | sed 's|github.com|api.github.com/repos|')"
|
||||||
|
api="$(curl "$app" | jq -r .[].assets[].browser_download_url | grep 'AppImage$')"
|
||||||
|
link="$(echo "$api" | grep "$(uname -m)" || echo "$api" | grep -vEe '-(aarch|arm)(64|hf)\.AppImage')"
|
||||||
shift
|
shift
|
||||||
set -- "$(curl "$app" | grep -om1 "https.*$(uname -m)\.AppImage\|https.*[^-arm64]\.AppImage")" "$@"
|
set -- "$(echo "$link" | head -n1)" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
app=$(basename "$1") # actually try to get the appimage
|
app=$(basename "$1") # actually try to get the appimage
|
||||||
|
|
Loading…
Reference in a new issue