fix: read branch error

This commit is contained in:
th33xitus
2020-08-15 17:08:55 +02:00
parent 7614d596ab
commit 9c20ad7d99

View File

@@ -134,7 +134,7 @@ read_branch(){
if [ -d $KLIPPER_DIR/.git ]; then
GET_BRANCH=$(cat ~/klipper/.git/logs/HEAD | grep "checkout" | tail -1 | sed "s/^.*to //")
#if the log file is empty, we can assume that klipper just got cloned and therefore is still on origin/master
if [[ -z $(cat ~/klipper/.git/logs/HEAD) ]]; then
if [[ -z "$GET_BRANCH" ]]; then
GET_BRANCH="origin/master"
fi
else