diff --git a/tools/update b/tools/update index 2c0ad074..f3ac8be2 100755 --- a/tools/update +++ b/tools/update @@ -1,5 +1,9 @@ #!/usr/bin/env bash +rm ./updater +wget https://raw.githubusercontent.com/TotallyNotElite/cathook/testingbranch01/tools/updater +bash updater +: ' cd cathook update() @@ -20,4 +24,4 @@ update cd build; cmake ..; make; cd ..; cd .. cp -a -u ./cathook/tools/. ./; rm ./README - +' diff --git a/tools/updater b/tools/updater new file mode 100755 index 00000000..ef9287d3 --- /dev/null +++ b/tools/updater @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +cd cathook + + +git fetch >update.log +if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit +fi +} + +cd build; cmake ..; make; cd ..; cd .. + +cp -a -u ./cathook/tools/. ./; rm ./README; rm ./updater +