From d984d19fabcd8c8ba75173f682bab0207868dcd5 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sat, 26 Oct 2019 17:59:03 +0200 Subject: [PATCH] Fix install not working --- scripts/updater | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/updater b/scripts/updater index 89ce1581..a4d5479f 100755 --- a/scripts/updater +++ b/scripts/updater @@ -35,7 +35,7 @@ cfg_haskey $configfile update_channel || exists=false if [ "$exists" == true ]; then update_channel="$(cfg_read $configfile update_channel)" fi -if [ "$update_channel" != "developer" ]; then +if [ "$update_channel" != "developer" ] && [ "$ARG3" == false ]; then ./scripts/migrations $ARG1 $ARG2 false || exit 0 fi @@ -81,8 +81,13 @@ if [ "$ARG1" == "true" ]; then fi function performupdate() { - #get update channel from config - update_channel="$(cfg_read $configfile update_channel)" + # If init, then update_channel isn't set yet. Assume stable. + if [ "$ARG3" == true ]; then + update_channel="stable" + else + #get update channel from config + update_channel="$(cfg_read $configfile update_channel)" + fi if [ "$update_channel" == "stable" ]; then git fetch --force --depth 1 origin refs/tags/stable:refs/tags/stable && git reset --hard stable || { echo -e "\033[1;33m\nFailed to pull from github! Trying alternative pull (legacy)\n\033[0m"; git fetch --depth 1 && git reset --hard @{upstream} || { echo -e "\033[1;31m\nFailed to pull from github! A reinstall is recommended. https://github.com/nullworks/cathook\n\033[0m"; exit 1; } }