Bugfix: Neuste verfügbare Version konnte nicht mehr ermittelt werden

This commit is contained in:
Tim Peters 2022-09-14 10:24:42 +02:00
parent 362714817d
commit ef9ee6f787

View File

@ -16,6 +16,11 @@ handleError() {
EOT
}
err() {
echo "${COLOR_RED}$*${COLOR_RESET}"
exit 1
}
showLogo() {
echo -n "${COLOR_GREEN}"
cat <<-'EOT'
@ -62,7 +67,8 @@ showHelp() {
}
getVersionLatest() {
VERSION_LATEST="$( wget -qO - https://github.com/logseq/logseq/releases/latest | grep -Poi "Logseq-linux-x64-\K\d\.\d\.\d" | head -n 1 )"
VERSION_LATEST="$( wget -qO - https://github.com/logseq/logseq/releases/latest | grep -Poi "releases/tag/\K\d\.\d\.\d" | head -n 1 )"
[ -n "$VERSION_LATEST" ] || err "Konnte nicht ermittelt werden"
}
getVersionCurrent() {
@ -74,11 +80,12 @@ getVersionCurrent() {
else
VERSION_CURRENT=
fi
[ -n "$VERSION_CURRENT" ] || err "Konnte nicht ermittelt werden"
}
getLatest() {
local URL
URL="https://github.com$( wget -qO - https://github.com/logseq/logseq/releases/latest | grep -Poi "/logseq.*AppImage" )"
URL="https://github.com/logseq/logseq/releases/download/$VERSION_LATEST/Logseq-linux-x64-$VERSION_LATEST.AppImage"
local DIR_DEST
DIR_DEST=~/.local/bin
local FILE_LINK