Fix install not working

This commit is contained in:
TotallyNotElite 2019-10-26 17:59:03 +02:00
parent 40c731d2ec
commit d984d19fab

View File

@ -35,7 +35,7 @@ cfg_haskey $configfile update_channel || exists=false
if [ "$exists" == true ]; then if [ "$exists" == true ]; then
update_channel="$(cfg_read $configfile update_channel)" update_channel="$(cfg_read $configfile update_channel)"
fi fi
if [ "$update_channel" != "developer" ]; then if [ "$update_channel" != "developer" ] && [ "$ARG3" == false ]; then
./scripts/migrations $ARG1 $ARG2 false || exit 0 ./scripts/migrations $ARG1 $ARG2 false || exit 0
fi fi
@ -81,8 +81,13 @@ if [ "$ARG1" == "true" ]; then
fi fi
function performupdate() { function performupdate() {
#get update channel from config # If init, then update_channel isn't set yet. Assume stable.
update_channel="$(cfg_read $configfile update_channel)" 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 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; } } 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; } }