Created
August 23, 2023 18:36
-
-
Save drabb/76b12b9cdc85c1f0a4b91e2e564747f7 to your computer and use it in GitHub Desktop.
feature_branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ "$1" == "-c" ]]; then | |
git checkout "$(git branch | awk '{$1=$1};1' | awk '!/\*/ {print $0}' | gum choose --height=20)" && git pull | |
else | |
#PREFIX=$(gum input --placeholder "Prefix" --value "CU") | |
PREFIX="CU" | |
TASK=$(gum input --placeholder "ClickUP Task ID") | |
TASK="${PREFIX}-${TASK:1}" | |
DESC=$(gum input --placeholder "Snake case feature name") | |
branch="${TASK}_${DESC}" | |
gum spin -s line --title "Pulling latest changes from master" -- git com | |
gum spin -s line --title "Creating new feature branch ${branch} from master" -- git checkout -b $branch | |
gum style --foreground 212 "Done!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment