Changes in the git-delete-branch

This commit is contained in:
Marcin Woźniak 2023-01-21 21:02:59 +01:00
parent 85a98b8019
commit c6c67a633d
Signed by: y0rune
GPG Key ID: F204C385F57EB348
1 changed files with 15 additions and 8 deletions

View File

@ -17,13 +17,8 @@ function list_of_the_branches() {
echo echo
} }
BRANCH="$1" function remove_branch() {
BRANCH="$1"
while true; do
[ -z "$BRANCH" ] && {
list_of_the_branches
read -p "Select branch to remove: " BRANCH
}
echo "$BRANCH" echo "$BRANCH"
read -p "Remove locally / remote / both [L/R/B]: " CHOOSE read -p "Remove locally / remote / both [L/R/B]: " CHOOSE
case $CHOOSE in case $CHOOSE in
@ -42,4 +37,16 @@ while true; do
;; ;;
*) echo "Please write good answer" ;; *) echo "Please write good answer" ;;
esac esac
done }
BRANCH="$1"
if [ -z "$BRANCH" ]; then
while true; do
list_of_the_branches
read -p "Select branch to remove: " BRANCH
remove_branch "$BRANCH"
done
else
remove_branch "$BRANCH"
fi