-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcb
More file actions
108 lines (80 loc) · 1.98 KB
/
Copy pathcb
File metadata and controls
108 lines (80 loc) · 1.98 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
fa
# # emojiType of commit
emjArr=(
[0]=':bug:'
[1]=':bulb:'
[2]=':hammer:'
[3]=':moneybag:'
[4]=':star:'
[5]=':fire:'
[6]=':cloud:'
[7]=':snowflake:'
[8]=':volcano:'
[9]=':heavy_check_mark:'
[10]=':ghost:'
[11]=':pushpin:'
['bug']=':bug:'
['idea']=':bulb:'
['fix']=':hammer:'
['money']=':moneybag:'
['star']=':star:'
['fire']=':fire:'
['cloud']=':cloud:'
['snow']=':snowflake:'
['volcano']=':volcano:'
['check']=':heavy_check_mark:'
['tick']=':heavy_check_mark:'
['ghost']=':ghost:'
['pin']=':pushpin:'
)
for i in "${!emjArr[@]}"; do
echo "$i ${emjArr[$i]}";
done
read -p '(0 bug) :' emojiType
# default value set
emojiType=${emojiType:-0}
slectedEmoji=${emjArr[$emojiType]}
printf " \n \n "
# read input
read -p 'Branch Name: ' str
str=${str:-0}
# Commit and push
if [ "$str" == 0 ]
then
printf " \n \n "
echo "Please provide name for branch"
exit
fi
# convert to space to dash
dashedString=$(sed "s/ /-/g" <<< $str)
# convert to lower case
lowercaseStr=${dashedString,,}
git stash
printf " \n \n "
read -p 'Create from branch current 1 (0 from main) :' fromBranch
# default value set
fromBranch=${fromBranch:-0}
if [ "$fromBranch" == 0 ]
then
git checkout main
git pull origin main
fi
branchName="$lowercaseStr"
git checkout -b $branchName
git push origin $branchName
# filename='Changelog.md'
# printf " \n \n "
# echo "Linked $branchName -> $(date) " >> $filename
# git add .
# git commit -am " :tada: init $slectedEmoji"
# read -p 'Assign to milestone :type in here (0 no) :' milstone
# # default value set
# milstone=${milstone:-0}
# if [ "$milstone" == 0 ]
# then
# hub pull-request -m "$nextPrId.$str $slectedEmoji" -a "$(git config user.name)" -l bug
# else
# hub pull-request -m "$nextPrId.$str $slectedEmoji" -a "$(git config user.name)" -l bug -M $milstone
# fi
# hub pull-request -m "$nextPrId.$str $slectedEmoji" -a "$(git config user.name)" -l bug
# gh pr view --web