Skip to content

Commit

Permalink
check-format-commit.sh: make awk patterns more robust for MacOS and c…
Browse files Browse the repository at this point in the history
…ertain flavors of Linux
  • Loading branch information
DDvO committed Oct 10, 2024
1 parent ee0bf38 commit 3ea792b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/check-format-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ fi
touch $TEMPDIR/ranges.txt
git diff -U0 $COMMIT_RANGE | awk '
BEGIN {myfile=""}
/+{3}/ {
gsub(/b\//,"",$2);
/^\+\+\+/ {
sub(/^b./,"",$2);
myfile=$2
}
/@@/ {
gsub(/+/,"",$3);
/^@@/ {
sub(/^\+/,"",$3);
printf myfile " " $3 "\n"
}' >> $TEMPDIR/ranges.txt || true
}' > $TEMPDIR/ranges.txt || true

# filter in anything that matches on a filter regex
for i in ${FILE_ALLOWLIST[@]}
Expand Down

0 comments on commit 3ea792b

Please sign in to comment.