Skip to content

Commit 277938b

Browse files
committed
fix: 🐛 reorder flow branch checks for clarity
1 parent 6e8fbc4 commit 277938b

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/gitutils/_git-release-prod.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ if [ -n "$(git branch --list hotfix/*)" ]; then
1414
flow=hotfix
1515
name=$(git branch --list hotfix/* | sed 's/.*hotfix\///'| head -n1 )
1616
zz_log i "Hotfix branch found: {Yellow $name}"
17-
fi
1817

19-
# Check if on a release branch and extract branch name
20-
if [ -n "$(git branch --list release/*)" ]; then
18+
# Check for .git/RELEASE file if no flow branch found
19+
elif [ -z "$flow" ] && [ -f .git/RELEASE ]; then
2120
flow=release
22-
name=$(git branch --list release/* | sed 's/.*release\///' | head -n1 )
21+
name=$(cat .git/RELEASE)
2322
zz_log i "Release branch found: {Blue $name}"
24-
fi
2523

26-
# Check if a flow branch is found from .git/RELEASE file
27-
if [ -z "$flow" ] && [ -f .git/RELEASE ]; then
24+
# Check if on a release branch and extract branch name
25+
elif [ -n "$(git branch --list release/*)" ]; then
2826
flow=release
29-
name=$(cat .git/RELEASE)
27+
name=$(git branch --list release/* | sed 's/.*release\///' | head -n1 )
3028
zz_log i "Release branch found: {Blue $name}"
3129
fi
3230

0 commit comments

Comments
 (0)