Skip to content

Commit

Permalink
Replace newline to space with xargs
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Dec 28, 2023
1 parent 8cc91dc commit c2d2e61
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .ci/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ get_translators_to_check() {
# when running from a local development PR branch
#
# The branching point hash retrieval logic is based on https://stackoverflow.com/a/12185115/3199106

TRANSLATORS_TO_CHECK=""

# Push to master
if [ "${GITHUB_REF:-}" = "refs/heads/master" ]; then
before_commit=$(jq -r '.before' $(echo $GITHUB_EVENT_PATH))
TRANSLATORS_TO_CHECK=$(git diff $before_commit --name-only | { grep -e "^[^/]*.js$" || true; })
TRANSLATORS_TO_CHECK=$(git diff $before_commit --name-only | { grep -e "^[^/]*.js$" || true; } | xargs)
# Pull request
else
# Gets parent commits. Either one or two hashes
Expand All @@ -49,11 +49,11 @@ get_translators_to_check() {
if [ $num_parent_commits -gt 1 ]; then
first_parent=$(git rev-list --first-parent ^master HEAD^2 | tail -n1)
branch_point=$(git rev-list "$first_parent^^!")
TRANSLATORS_TO_CHECK=$(git diff HEAD^2 $branch_point --name-only | { grep -e "^[^/]*.js$" || true; })
TRANSLATORS_TO_CHECK=$(git diff HEAD^2 $branch_point --name-only | { grep -e "^[^/]*.js$" || true; } | xargs)
else
first_parent=$(git rev-list --first-parent ^master HEAD | tail -n1)
branch_point=$(git rev-list "$first_parent^^!")
TRANSLATORS_TO_CHECK=$(git diff $branch_point --name-only | { grep -e "^[^/]*.js$" || true; })
TRANSLATORS_TO_CHECK=$(git diff $branch_point --name-only | { grep -e "^[^/]*.js$" || true; } | xargs)
fi
fi
}

0 comments on commit c2d2e61

Please sign in to comment.