forked from akshaynagpal/w2n
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdevelop.sh
More file actions
executable file
·51 lines (43 loc) · 913 Bytes
/
develop.sh
File metadata and controls
executable file
·51 lines (43 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/zsh
function upgradeAllLocalBranchesFromMaster {
for BRANCH in `git branch | cut -c 3-`
do
git switch $BRANCH
git merge origin/master
git pull
done
git switch master
}
function showHelp {
echo ' -h show this help'
echo ' -u upgrade all local branches from master'
echo ' with call git switch <branch> git merge origin/master'
}
echo "Please wait..."
while true
do
case "$1" in
"-h") shift && showHelp || die
;;
"-u") echo "<drink coffee to start the engine>" && echo " " && sleep 3 && upgradeAllLocalBranchesFromMaster
;;
esac
if [ "$#" -eq "0" ]
then
break;
fi
shift || break
done
echo " "
echo "I need more coffee!"
exit
# save for later
while getopts h:u: argument
do
case "${argument}"
in
h) showHelp;;
u) upgradeAllLocalBranchesFromMaster;;
esac
done
#EOF