Skip to content

Commit

Permalink
Add temp /k command to choose channel
Browse files Browse the repository at this point in the history
This utilises gum choose to let you select.

I probably want to push this fuctionality back to the /switch command
so that it lets you choose unless you specify a channel directly.
  • Loading branch information
JKrag committed Mar 6, 2023
1 parent 489030c commit c760143
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chat-gum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ while true ; do
title
echo "Showing last 5 messages in $options"
git chatlog -5
elif [[ "$cm" = "/k" ]]; then
NEWCHAN=$(gum choose --height=10 --selected=$(git branch --show-current) --limit=1 $(get_branches))
echo "Switching to $NEWCHAN"
git switch "$NEWCHAN"
title
echo "Showing last 5 messages in $options"
git chatlog -5
elif [[ "$cm" = "/list" || "$cm" = "/l" ]]; then
echo -e "Existing channels: (use ${GREEN}/switch <channelname>${RC} to change channel"
git branch -a
Expand Down

0 comments on commit c760143

Please sign in to comment.