Löschen veralteter Logseq Versionen
This commit is contained in:
parent
e7f61e9120
commit
d89cea4e70
@ -48,7 +48,7 @@ getVersionLatest() {
|
||||
}
|
||||
|
||||
getVersionCurrent() {
|
||||
local FILENAME="$( find ~/.local/bin/ -iname Logseq-\*AppImage )"
|
||||
local FILENAME="$( ls -1rt ~/.local/bin/Logseq-*AppImage | head -n1 )"
|
||||
if [ -n "$FILENAME" ]; then
|
||||
VERSION_CURRENT="$( echo $FILENAME | grep -Poi "Logseq-linux-x64-\K\d\.\d\.\d" | head -n 1 )"
|
||||
else
|
||||
@ -59,11 +59,16 @@ getVersionCurrent() {
|
||||
getLatest() {
|
||||
local URL="https://github.com$( wget -qO - https://github.com/logseq/logseq/releases/latest | grep -Poi "/logseq.*AppImage" )"
|
||||
local DIR_DEST=~/.local/bin
|
||||
local FILE_DELETE=
|
||||
|
||||
FILENAME_LOGSEQ="$( basename "$URL" )"
|
||||
mkdir -p $DIR_DEST
|
||||
wget $URL --show-progress -qO $DIR_DEST/$FILENAME_LOGSEQ
|
||||
chmod u+x $DIR_DEST/$FILENAME_LOGSEQ
|
||||
|
||||
# Veraltete Versionen löschen
|
||||
FILE_DELETE="$( find ~/.local/bin -iname Logseq-\*AppImage | grep -v $FILENAME_LOGSEQ )"
|
||||
[ -n "$FILE_DELETE" ] && rm -f $FILE_DELETE
|
||||
}
|
||||
|
||||
createDesktop() {
|
||||
|
Loading…
Reference in New Issue
Block a user