Browse Source

added branch switching

#146
rootzoll 6 years ago
parent
commit
4b13ff93ee
  1. 17
      home.admin/XXupdateScripts.sh

17
home.admin/XXupdateScripts.sh

@ -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

Loading…
Cancel
Save