diff options
-rwxr-xr-x | tcwg-release.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tcwg-release.sh b/tcwg-release.sh index 9cfc601..6a4bf95 100755 --- a/tcwg-release.sh +++ b/tcwg-release.sh @@ -153,9 +153,14 @@ clean() { rm -rf $REL_DIR/git fi fi - ask "${bold}May I remove the local branch named \"${local_branch}\" as part of the cleanup process [N/y] ?${NC}" user_ok - if [ "$user_ok" = "y" ]; then - git branch -D ${local_branch} + + # check to see if the local_branch has been created. + git rev-parse --verify ${local_branch} &>/dev/null + if [ $? -eq 0 ]; then + ask "${bold}May I remove the local branch named \"${local_branch}\" as part of the cleanup process [N/y] ?${NC}" user_ok + if [ "$user_ok" = "y" ]; then + git branch -D ${local_branch} + fi fi # If there is a tag created/associated with this release then it should |