@@ -13,11 +13,6 @@ NC=$'\e[0m' # No Color
1313# Error codes
1414declare -A err=([BADPARAM]=1 [NOPR]=2 [NOCOMMS]=3 [UNDEFTYPE]=4 [ADDFAIL]=5)
1515
16- # Function to print colored output
17- print_status () {
18- printf " ${BLUE} %s${NC} \n" " $@ "
19- }
20-
2116print_header () {
2217 printf " ${PURPLE} %s${NC} \n" " $@ "
2318}
@@ -27,7 +22,7 @@ print_error() {
2722}
2823
2924print_info () {
30- printf " ${CYAN } %s${NC} \n" " $@ "
25+ printf " ${NC } %s\n" " $@ "
3126}
3227
3328print_success () {
@@ -129,7 +124,7 @@ ghPost() {
129124
130125
131126print_header ' 💬 GitHub PR Reaction Tool'
132- echo ' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ '
127+ print_info ' ——————————————————————————————————————————————————— '
133128print_info " Fetching comments for PR #$( hl " $PR_NUMBER " ) ..."
134129
135130print_info " Repository: $( hl " $repo " ) "
@@ -144,7 +139,7 @@ if [ -z "$PR_EXISTS" ]; then
144139 $( tip) Make sure you're in the correct repository and the PR number exists.
145140 EOF
146141fi
147- print_status " PR #$PR_NUMBER found!"
142+ print_success " PR #$PR_NUMBER found!"
148143
149144# Use gh api to get raw comments for the issue/PR
150145echo " "
@@ -179,21 +174,21 @@ if [ "$COMMENT_COUNT" -eq 0 ]; then
179174 EOF
180175fi
181176
182- print_status " Found $( hl " $COMMENT_COUNT " ) items to react to!"
177+ print_success " Found $( hl " $COMMENT_COUNT " ) items to react to!"
183178echo " "
184179print_info " $( hl 📋 Available content:) "
185- echo ' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ '
180+ echo ' ——————————————————————————————————————————————————— '
186181
187182# Format and display comments with numbers
188183< " $commentsFile " render '
189184 to_entries[] | {ix: .key + 1} + .value
190185 | "[\(.ix)] \(renderType) by \(renderUser)\n\(renderBody)"
191186 '
192187
193- echo " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ "
188+ echo ' ——————————————————————————————————————————————————— '
194189echo " "
195190print_info " $( hl 😊 Choose what to react to:) "
196- while read -rp " � Enter number (1-$COMMENT_COUNT ): " SELECTION; do
191+ while read -rp " Enter number (1-$COMMENT_COUNT ): " SELECTION; do
197192 # Validate selection is a number and in range
198193 if [[ " $SELECTION " =~ ^[0-9]+$ ]] \
199194 && [ " $SELECTION " -ge 1 ] \
@@ -223,7 +218,6 @@ select REACTION in "${!reactions[@]}"; do
223218done
224219unset PS3
225220
226-
227221echo " "
228222print_info " Sending $( hl " $REACTION " ) reaction to comment $( hl " $COMMENT_ID " ) ..."
229223declare -A endpoints=(
@@ -251,18 +245,5 @@ if ! RESPONSE=$(ghPost "${endpoints[$COMMENT_TYPE]}"/"$COMMENT_ID"/reactions \
251245 EOF
252246fi
253247
254- echo " "
255248print_success " Reaction added successfully! 🎉"
256- echo " "
257249echo -e " $( hl 🔗 View PR:) https://github.com/$repo /pull/$PR_NUMBER "
258-
259- # Show reaction emoji based on type
260- case $REACTION in
261- " +1" ) echo -e " ${GREEN} 👍 Added thumbs up!${NC} " ;;
262- " -1" ) echo -e " ${RED} 👎 Added thumbs down!${NC} " ;;
263- " laugh" ) echo -e " ${YELLOW} 😄 Added laugh!${NC} " ;;
264- " heart" ) echo -e " ${RED} ❤️ Added heart!${NC} " ;;
265- " hooray" ) echo -e " ${PURPLE} 🎉 Added hooray!${NC} " ;;
266- " rocket" ) echo -e " ${BLUE} 🚀 Added rocket!${NC} " ;;
267- " eyes" ) echo -e " ${CYAN} 👀 Added eyes!${NC} " ;;
268- esac
0 commit comments