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 0ee9533 commit 3c70398
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/i18n-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ 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 ]]; then
# Get last commit of `main` that this branch is rooted from.
LASTCOMMIT=$(git merge-base main HEAD)
elif ! (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

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 3c70398

Please sign in to comment.