mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 20:32:52 +02:00
added branch switching
This commit is contained in:
@@ -1,7 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/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 ""
|
||||||
echo "*** UPDATING SHELL SCRIPTS FROM GITHUB ***"
|
echo "*** UPDATING SHELL SCRIPTS FROM GITHUB ***"
|
||||||
echo "justincase, not the final upadte mechanism"
|
echo "justincase, not the final upadte mechanism"
|
||||||
|
echo "BRANCH --> ${activeBranch}"
|
||||||
echo "******************************************"
|
echo "******************************************"
|
||||||
cd /home/admin/raspiblitz
|
cd /home/admin/raspiblitz
|
||||||
git pull
|
git pull
|
||||||
|
Reference in New Issue
Block a user