Replace csplit with perl in rebar3-format.sh

Bsd csplit doesn't offer some options that we require, so let's use perl
that should work everywhere
This commit is contained in:
Paweł Chmielowski
2025-06-06 16:52:28 +02:00
parent 0bb99bb371
commit 95a083a6f4
+1 -1
View File
@@ -17,7 +17,7 @@ FPATH=$1
ERLS=$(git grep --name-only @format-begin "$FPATH"/)
for ERL in $ERLS; do
csplit --quiet --prefix=$ERL-format- $ERL /@format-/ "{*}"
perl -n -e 'sub o { open(OUT, ">", sprintf("%s-format-%02d", $f, $n++));}; BEGIN{($f)=@ARGV;o()}; o() if /\@format-/; print OUT $_;' $ERL
done
EFMTS=$(find "$FPATH"/*-format-* -type f -exec grep --files-with-matches "@format-begin" '{}' ';')