Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
auto-update unless no-update-patcher exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Botspot committed Dec 4, 2020
1 parent c8e8c15 commit ab4a417
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ if [ ! -f ~/.config/autostart/twistup.desktop ];then
echo "[Desktop Entry]
Type=Application
Name=TwistUP
Comment=Initial setup for Twister OS
Comment=Twister OS Patcher (TwistUP)
Exec=twistpatch gui-autostart
OnlyShowIn=XFCE;
StartupNotify=false
Expand Down Expand Up @@ -235,6 +235,16 @@ if [ -z "$runmode" ];then
runmode=gui
fi

if [ ! -f "${DIRECTORY}/no-update-patcher" ];then
localhash="$(git rev-parse HEAD)"
latesthash="$(git ls-remote https://github.com/Botspot/TwistUP HEAD | awk '{print $1}')"
if [ "$localhash" != "$latesthash" ] && [ ! -z "$latesthash" ] && [ ! -z "$localhash" ];then
echo "TwistUP is out of date. Downloading new version..."
gio trash "$DIRECTORY"
git clone https://github.com/Botspot/TwistUP "$DIRECTORY"
fi
fi

if [[ "$runmode" == cli* ]] || [ "$runmode" == gui-update ];then
if [ "$latestversion" == "$localversion" ];then
#no update available
Expand Down

0 comments on commit ab4a417

Please sign in to comment.