-
Notifications
You must be signed in to change notification settings - Fork 0
/
paxmmit
executable file
·161 lines (124 loc) · 5.12 KB
/
paxmmit
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash
<<<<<<< HEAD
=======
# paxmmit V3
>>>>>>> pax-app/Wiki#163 Create provider_card
# Create message with proper reference to rep issue based on branch name ddd_issueName
# Then add all changes in unstaged and commit with the respective message
# Author: Rogério Júnior
<<<<<<< HEAD
declare number
number=$(git branch | grep '*' | sed 's/.*\([0-9]\{3\}\).*/\1/')
if [ $number -eq $number 2> /dev/null ]; then
read -p "Message: " message
message="pax-app/Wiki#$number $message"
echo -e "\n"
read -p "Are you pairing? (y/n) " pairing
if [ $pairing == "y" ]; then
declare -A map
map["albino"]="Co-authored-by: Gabriel Albino <[email protected]>"
map["dutra"]="Co-authored-by: Lucas Dutra <[email protected]>"
map["esio"]="Co-authored-by: Esio Freitas <[email protected]>"
map["fabi"]="Co-authored-by: Fabiana Ribas <[email protected]>"
map["fepas"]="Co-authored-by: Felipe Campos <[email protected]>"
map["kaique"]="Co-authored-by: Kaique Borges <[email protected]>"
map["marcos"]="Co-authored-by: Marcos Nery <[email protected]>"
map["matheus"]="Co-authored-by: Matheus Pimenta <[email protected]>"
map["roger"]="Co-authored-by: Rogério Júnior <[email protected]>"
map["youssef"]="Co-authored-by: Youssef Muhamad <[email protected]>"
declare flag="y"
echo -e "\n"
while [ $flag == 'y' ]; do
read -p "With who? " pairing_name
message+="\n\n${map[${pairing_name}]}"
echo -e "\n"
read -p "Anyone else? (y/n) " flag
echo -e "\n"
=======
if [ ! -z "$1" -a "$1" != " " ]; then
bold=$(tput bold)
normal=$(tput sgr0)
declare number
number=$(git branch | grep '*' | sed 's/.*\([0-9]\{3\}\).*/\1/')
if [ $number -eq $number 2> /dev/null ]; then
number=$number
else
echo -e "${bold}@@@@@@@@@@@@@@@@@@@@@@@@@@@ W A R N I N G @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@${normal}"
echo -e "\nYou're out of a issue branch, the only way of contibuiting to Pax Org! :X "
echo -e "\nAre you ${bold}absolutely${normal} certain to try to commit in ${bold}$(git branch | grep '*' | sed 's|[*]||g')${normal} ? (it maybe be ${bold}refused${normal} on Github)\n"
read -p "(${bold}y/n${normal}) " flag
if [ $flag == "n" ]; then
exit 1
fi
echo ""
read -p "What's the ${bold}issue number${normal}? " number
echo ""
fi
message="pax-app/Wiki#$number $1"
read -p "Are you ${bold}pairing${normal}? (${bold}y/n${normal}) " pairing
echo ""
if [ $pairing != "n" ]; then
declare -A map
map["a"]="Co-authored-by: Gabriel Albino <[email protected]>"
map["d"]="Co-authored-by: Lucas Dutra <[email protected]>"
map["e"]="Co-authored-by: Esio Freitas <[email protected]>"
map["fa"]="Co-authored-by: Fabiana Ribas <[email protected]>"
map["fe"]="Co-authored-by: Felipe Campos <[email protected]>"
map["k"]="Co-authored-by: Kaique Borges <[email protected]>"
map["mar"]="Co-authored-by: Marcos Nery <[email protected]>"
map["mat"]="Co-authored-by: Matheus Pimenta <[email protected]>"
map["r"]="Co-authored-by: Rogério Júnior <[email protected]>"
map["y"]="Co-authored-by: Youssef Muhamad <[email protected]>"
declare flag="y"
message+="\n"
while [ $flag != 'n' ]; do
echo -e "With who?\n"
read -p "(${bold}a${normal})lbino/(${bold}d${normal})utra/(${bold}e${normal})sio/(${bold}fa${normal})bi/(${bold}fe${normal})pas/(${bold}k${normal})aique/(${bold}mar${normal})cos/(${bold}mat${normal})heus/(${bold}r${normal})oger/(${bold}y${normal})oussef " pairing_name
echo ""
message+="\n${map[${pairing_name}]}"
read -p "Anyone else? (${bold}y/n${normal}) " flag
echo ""
>>>>>>> pax-app/Wiki#163 Create provider_card
done
fi
<<<<<<< HEAD
echo -e "\nCan I commit all changes with this message?(y/n)\n\n\n$message\n"
read flag
if [ $flag == 'y' ]; then
git add .
git commit -m"$(echo -e $message)"
echo -e "\n\n\n"
echo -e "\n\nEverything commited!! ;)"
else
echo -e "\n\n\n"
echo "Run me again! :("
fi
else
echo -e "\nWhere's the issue number dumbass??? :s \n"
=======
echo -e "That's the correct message ?\n\n\n$message\n\n"
read -p "(${bold}y/n${normal}): " flag
if [ $flag != 'n' ]; then
echo ""
read -p "What do you want do stage? (${bold}e${normal})verything/(${bold}s${normal})omethings/(${bold}n${normal})othing " flag
echo ""
if [ $flag == 'e' ]; then
git add .
else
if [ $flag == 's' ]; then
echo -e "Let's ${bold}stage${normal} the changes!\n\n"
git add -i
echo ""
fi
fi
git commit -m"$(echo -e $message)"
echo -e "\n\n"
echo -e "${bold}Everything commited!! ;)"
else
echo -e "\n\n"
echo "${bold}Run me again! :("
fi
else
echo -e "Wheres the message?! Run me again"
>>>>>>> pax-app/Wiki#163 Create provider_card
fi