Skip to content

Commit

Permalink
Merge pull request #911 from ivan-hc/main
Browse files Browse the repository at this point in the history
Update duckstation
  • Loading branch information
ivan-hc authored Aug 31, 2024
2 parents bc13dd3 + 1ad7eb6 commit 732fb0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions programs/x86_64/duckstation
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove
chmod a+x ../remove || exit 1

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l\|latest\|preview" | head -1)
wget "$version" || exit 1
version=$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases/latest | sed 's/[()",{} ]/\n/g' | grep "^http" | head -1)
wget "$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases/latest | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | head -1)" || exit 1
#wget "$version.zsync" 2> /dev/null # Comment out this line if you want to use zsync
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
Expand All @@ -33,12 +33,12 @@ set -u
APP=duckstation
SITE="stenzek/duckstation"
version0=$(cat "/opt/$APP/version")
version=$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l\|latest\|preview" | head -1)
version=$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases/latest | sed 's/[()",{} ]/\n/g' | grep "^http" | head -1)
[ -n "$version" ] || { echo "Error getting link"; exit 1; }
if [ "$version" != "$version0" ] || [ -e /opt/"$APP"/*.zsync ]; then
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
[ -e ../*.zsync ] || notify-send "A new version of $APP is available, please wait"
[ -e ../*.zsync ] && wget "$version.zsync" 2>/dev/null || { wget "$version" || exit 1; }
[ -e ../*.zsync ] && wget "$version.zsync" 2>/dev/null || { wget "$(curl -Ls https://api.github.com/repos/stenzek/duckstation/releases/latest | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | head -1)" || exit 1; }
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null || mv --backup=t ./tmp/*mage ./"$APP"
Expand Down

0 comments on commit 732fb0c

Please sign in to comment.