-
Notifications
You must be signed in to change notification settings - Fork 9
/
gg-release-open
executable file
·40 lines (34 loc) · 1.13 KB
/
gg-release-open
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
#!/bin/bash
installPath=/usr/local/bin/gg
source $installPath/gg-functions
testClear
get_currentBranch
get_currentBranchType
if [[ $currentBranchType != 'develop' && $currentBranchType != 'pointer' ]]; then
printf "\nYou must be in the develop branch or in the detached commint in the develop branch to create a new feature branch!\n\n"
git status
exit 1
fi
if [[ "$#" != "1" ]]; then
echo "your are in branch $currentBranch, Please input release number"
printf "Current tag names are\n"
git --no-pager tag
exit 1
fi
get_release
printf "Do you what to open a new release branch like this?\n"
if [[ "$1" == "none" ]]; then
gggttt;echo "git checkout -b \"$release\""
gggttt;echo "git commit --allow-empty -m \"Start release\""
echo "press ENTER to continue, press Ctrl+c to ESCAPE"
read temp
git checkout -b "$release"
git commit --allow-empty -m "Start release"
else
gggttt;echo "git checkout -b \"$release-$1\""
gggttt;echo "git commit --allow-empty -m \"Start release version $1\""
echo "press ENTER to continue, press Ctrl+c to ESCAPE"
read temp
git checkout -b "$release-$1"
git commit --allow-empty -m "Start release version $1"
fi