Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-hc authored Jan 13, 2025
1 parent c8a7440 commit d5c4819
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions programs/x86_64/glab
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ printf "#!/bin/sh\nset -e\nrm -f /usr/local/bin/$APP\nrm -R -f /opt/$APP" > ../r
chmod a+x ../remove || exit 1

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(wget -q https://repology.org/project/glab-gitlab-cli/versions -O - | grep -i "newest.*version" | head -1 | tr '><' '\n' | grep "^[0-9]")
wget "https://gitlab.com/gitlab-org/cli/-/releases/v$version/downloads/glab_"$version"_Linux_x86_64.tar.gz" || exit 1
version=$(curl -Ls https://gitlab.com/api/v4/projects/34675721/releases/ | tr '">< ' '\n' | grep -i "^http.*linux.*tar.gz" | grep -vi "i386\|i686\|aarch64\|arm64\|armv\|bsd\|ppc" | head -1)
wget "$version" || exit 1
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
Expand All @@ -33,12 +33,12 @@ set -u
APP=glab
SITE="https://gitlab.com/gitlab-org/cli"
version0=$(cat "/opt/$APP/version")
version=$(wget -q https://repology.org/project/glab-gitlab-cli/versions -O - | grep -i "newest.*version" | head -1 | tr '><' '\n' | grep "^[0-9]")
version=$(curl -Ls https://gitlab.com/api/v4/projects/34675721/releases/ | tr '">< ' '\n' | grep -i "^http.*linux.*tar.gz" | grep -vi "i386\|i686\|aarch64\|arm64\|armv\|bsd\|ppc" | head -1)
[ -n "$version" ] || { echo "Error getting link"; exit 1; }
if [ "$version" != "$version0" ]; then
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
notify-send "A new version of $APP is available, please wait"
wget "https://gitlab.com/gitlab-org/cli/-/releases/v$version/downloads/glab_"$version"_Linux_x86_64.tar.gz" || exit 1
wget "$version" || exit 1
[ -e ./*7z ] && 7z x ./*7z && rm -f ./*7z
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*
[ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
Expand Down
25 changes: 14 additions & 11 deletions programs/x86_64/sioyek
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ 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/ahrm/sioyek/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | head -1)
curl -Ls https://api.github.com/repos/ahrm/sioyek/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$\|https.*linux.*.zip$" | head -1
wget "$version" || 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.
# Keep this space in sync with other installation scripts
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*; [ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
cd ..
mv ./tmp/*mage ./"$APP"
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null
# Keep this space in sync with other installation scripts
rm -R -f ./tmp || exit 1
echo "$version" > ./version
chmod a+x ./"$APP" || exit 1
Expand All @@ -33,16 +33,19 @@ set -u
APP=sioyek
SITE="ahrm/sioyek"
version0=$(cat "/opt/$APP/version")
version=$(curl -Ls https://api.github.com/repos/ahrm/sioyek/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" | grep -vi "i386\|i686\|aarch64\|arm64\|armv7l" | head -1)
curl -Ls https://api.github.com/repos/ahrm/sioyek/releases | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$\|https.*linux.*.zip$" | head -1
[ -n "$version" ] || { echo "Error getting link"; exit 1; }
if [ "$version" != "$version0" ] || [ -e /opt/"$APP"/*.zsync ]; then
if command -v appimageupdatetool >/dev/null 2>&1; then
cd "/opt/$APP" || exit 1
appimageupdatetool -Or ./"$APP" && chmod a+x ./"$APP" && echo "$version" > ./version && exit 0
fi
if [ "$version" != "$version0" ]; 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; }
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
notify-send "A new version of $APP is available, please wait"
wget "$version" || exit 1
[ -e ./*tar.* ] && tar fx ./*tar.* && rm -f ./*tar.*; [ -e ./*zip ] && unzip -qq ./*zip 1>/dev/null && rm -f ./*zip
cd ..
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null || mv --backup=t ./tmp/*mage ./"$APP"
[ -e ./*.zsync ] && { zsync ./"$APP".zsync || notify-send -u critical "zsync failed to update $APP"; }
mv --backup=t ./tmp/*mage ./"$APP"
chmod a+x ./"$APP" || exit 1
echo "$version" > ./version
rm -R -f ./*zs-old ./*.part ./tmp ./*~
Expand Down

0 comments on commit d5c4819

Please sign in to comment.