mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 20:16:22 +02:00
added branch switching
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# change branch if set as parameter
|
||||
wantedBranch=$1
|
||||
activeBranch=$(git branch | grep \* | cut -d ' ' -f2)
|
||||
if [ ${#wantedBranch} -gt 0 ]; then
|
||||
echo "your wanted branch is: ${wantedBranch}"
|
||||
echo "your active branch is: ${activeBranch}"
|
||||
if [ "${wantedBranch}" = "${activeBranch}" ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "try changing branch .."
|
||||
git checkout ${wantedBranch}
|
||||
activeBranch=$(git branch | grep \* | cut -d ' ' -f2)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "*** UPDATING SHELL SCRIPTS FROM GITHUB ***"
|
||||
echo "justincase, not the final upadte mechanism"
|
||||
echo "BRANCH --> ${activeBranch}"
|
||||
echo "******************************************"
|
||||
cd /home/admin/raspiblitz
|
||||
git pull
|
||||
|
Reference in New Issue
Block a user