-
-
Notifications
You must be signed in to change notification settings - Fork 553
Open
Labels
linuxAffects Linux version (not Wine)Affects Linux version (not Wine)portableAffects the portable version of HeidiSQL onlyAffects the portable version of HeidiSQL only
Description
I did not like deb package because it depends on packages that I do not need (e.g. libsybdb5)
I made a script that automatically get latest linux release, check it version and update/install it if needed.
Just put it in any dir with write permission and run.
Currently it uses gtk version, but you can easyly change WS var
#!/bin/bash
set -e
WS=gtk
cd $(dirname $0)
[ ! -f version ] && touch version
INFO_URL=https://api.github.com/repos/HeidiSQL/HeidiSQL/releases
REL_OBJ=$(curl -s $INFO_URL | jq 'map(select(.name | contains("Linux"))) | first')
LOCAL_VER=$(cat version)
REMOTE_VER=$(echo $REL_OBJ | jq -r '.tag_name')
[ "$LOCAL_VER" = "$REMOTE_VER" ] && echo 'HeidiSQL is already up to date' && exit
DOWNLOAD_URL=$(echo $REL_OBJ | jq -r ".assets | map(select(.browser_download_url | contains(\"build-${WS}\"))) | first | .browser_download_url // \"\"")
[ -z "$DOWNLOAD_URL" ] && echo 'Can not get download url' && exit 1
if [ -n "$LOCAL_VER" ]
then
mkdir -p bak
BAK_SUFFIX=.tar.gz
BAK_FILE=$(mktemp --suffix=$BAK_SUFFIX)
tar --exclude=bak -czf $BAK_FILE .
mv $BAK_FILE bak/$LOCAL_VER$BAK_SUFFIX
find . -type f ! -name "$(basename $0)" ! -wholename "./bak/*" -exec rm -f {} +
fi
wget $DOWNLOAD_URL
tar xvf build-*.tgz
rm build-*.tgz
echo $REMOTE_VER > versionReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
linuxAffects Linux version (not Wine)Affects Linux version (not Wine)portableAffects the portable version of HeidiSQL onlyAffects the portable version of HeidiSQL only