From b044d7a9b35014529fcf565594754f669ba77022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 6 Apr 2022 07:34:50 +0200 Subject: [PATCH] git-delete-branch: Changed logic from and to or in both --- .local/bin/git-delete-branch | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.local/bin/git-delete-branch b/.local/bin/git-delete-branch index edfd49d..268a043 100755 --- a/.local/bin/git-delete-branch +++ b/.local/bin/git-delete-branch @@ -2,11 +2,11 @@ # shellcheck disable=2162 -function delete_local_branch(){ +function delete_local_branch() { git branch -D "$1" } -function delete_remote_branch(){ +function delete_remote_branch() { git push origin --delete "$1" } @@ -19,9 +19,12 @@ while true; do read -p "Select branch to remove: " BRANCH read -p "Remove locally / remote / both [L/R/B]: " CHOOSE case $CHOOSE in - [Bb]* ) delete_local_branch "$BRANCH" && delete_remote_branch "$BRANCH" ;; - [Ll]* ) delete_local_branch "$BRANCH";; - [Rr]* ) delete_remote_branch "$BRANCH";; - * ) echo "Please write good answer";; + [Bb]*) + delete_local_branch "$BRANCH" + delete_remote_branch "$BRANCH" + ;; + [Ll]*) delete_local_branch "$BRANCH" ;; + [Rr]*) delete_remote_branch "$BRANCH" ;; + *) echo "Please write good answer" ;; esac done