Skip to content

Commit

Permalink
Update i18n-check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Jun 7, 2024
1 parent 1481cb8 commit 7944866
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/i18n-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ function main() {
# Get commit hash from git commit info
LASTCOMMIT=$(git log -n 1 --pretty=format:%h -- "$f")
fi
if [[ -z $LASTCOMMIT ]] || ! git branch --contains $LASTCOMMIT | grep -q "^\s*main\b"; then
if [[ -z $LASTCOMMIT ]] || ! (git branch --contains "$LASTCOMMIT" | grep -q "^\s*main\b"); then
# Get last commit of `main` that this branch is rooted from.
LASTCOMMIT=$(git merge-base main HEAD)
fi
if ! git branch --contains $LASTCOMMIT | grep -q "^\s*main\b"; then
echo "Something is wrong, the hash isn't on 'main', aborting: $LASTCOMMIT"
if ! (git branch --contains "$LASTCOMMIT" | grep -q "^\s*main\b"); then
echo "Something is wrong, the hash is empty or isn't on 'main', aborting: $LASTCOMMIT - $f"
exit 2
fi

Expand Down

0 comments on commit 7944866

Please sign in to comment.