fix: previous klipper updates resulted in a detached head state. fixed update routine and other stuff relaying on the read_branch function/GET_BRANCH variable

This commit is contained in:
th33xitus
2020-12-20 18:41:42 +01:00
parent 06eb86efd7
commit 1eda775571
5 changed files with 28 additions and 63 deletions

View File

@@ -66,18 +66,8 @@ update_klipper(){
read_branch
save_klipper_state
status_msg "Updating $GET_BRANCH"
#fetching origin/master -> error
#rewriting origin/master to origin
if [ "$GET_BRANCH" = "origin/master" ]; then
FETCH_BRANCH="origin"
else
FETCH_BRANCH=$(echo "$GET_BRANCH" | cut -d "/" -f1)
fi
status_msg "Fetching from $FETCH_BRANCH"
cd $KLIPPER_DIR
git fetch $FETCH_BRANCH -q && ok_msg "Fetch successfull!"
status_msg "Checking out $GET_BRANCH"
git checkout $GET_BRANCH -q && ok_msg "Checkout successfull!"
cd $KLIPPER_DIR && git pull && ok_msg "Update successfull!"
#check for possible new dependencies and install them
status_msg "Checking for possible new dependencies ..."
PKGLIST=$(grep "PKGLIST=" ~/klipper/scripts/install-octopi.sh | cut -d'"' -f2- | cut -d'"' -f1 | cut -d"}" -f2)