Don't exit when getting no match for grep

Don't exit when getting no match for grep

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
pull/4643/head
Wenkai Yin(尹文开) 2022-02-15 14:09:34 +08:00
parent fad2df8740
commit f1dea158d0
1 changed files with 2 additions and 2 deletions

View File

@ -138,8 +138,8 @@ if [[ -n $release_branch_name ]]; then
remote_release_branch_name="$remote/$release_branch_name"
# Determine whether the local and remote release branches already exist
local_branch=$(git branch | grep "$release_branch_name")
remote_branch=$(git branch -r | grep "$remote_release_branch_name")
local_branch=$(git branch | { grep "$release_branch_name" || true; })
remote_branch=$(git branch -r | { grep "$remote_release_branch_name" || true;})
if [[ -z $remote_branch ]]; then
echo "The branch $remote_release_branch_name must be created before you tag the release."
exit 1