Skip to content

Commit b20cea4

Browse files
authored
fix logic error (#50)
1 parent ec72420 commit b20cea4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.scripts/package.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ latest_release_number () {
1111

1212
branch_exists () {
1313
# Check if the branch exists on the remote
14-
git ls-remote --heads origin "$1" 2>/dev/null | grep -q "$1" || echo 0
14+
ret=$(git ls-remote --heads origin "$1" 2>/dev/null | grep -q "$1"; echo $?)
15+
if [ $ret -eq 0 ]; then echo 1; else echo 0; fi
1516
}
1617

1718
pr_exists_and_open () {
1819
# Check if the PR exists and is open on the remote
19-
gh pr view $1 --json state | jq -r '.state' | grep -q "OPEN" || echo 0
20+
ret=$(gh pr view $1 --json state | jq -r '.state' | grep -q "OPEN"; echo $?)
21+
if [ $ret -eq 0 ]; then echo 1; else echo 0; fi
2022
}
2123

2224
is_pr_approved () {
2325
# Check if the PR needs review
24-
gh pr view $1 --json reviewDecision | jq -r '.reviewDecision' | grep -q "APPROVED" || echo 0
26+
ret=$(gh pr view $1 --json reviewDecision | jq -r '.reviewDecision' | grep -q "APPROVED"; echo $?)
27+
if [ $ret -eq 0 ]; then echo 1; else echo 0; fi
2528
}
2629

2730
xcframework_name () {

0 commit comments

Comments
 (0)