Skip to content

Commit 95a083a

Browse files
committed
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
1 parent 0bb99bb commit 95a083a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/rebar3-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FPATH=$1
1717
ERLS=$(git grep --name-only @format-begin "$FPATH"/)
1818

1919
for ERL in $ERLS; do
20-
csplit --quiet --prefix=$ERL-format- $ERL /@format-/ "{*}"
20+
perl -n -e 'sub o { open(OUT, ">", sprintf("%s-format-%02d", $f, $n++));}; BEGIN{($f)=@ARGV;o()}; o() if /\@format-/; print OUT $_;' $ERL
2121
done
2222

2323
EFMTS=$(find "$FPATH"/*-format-* -type f -exec grep --files-with-matches "@format-begin" '{}' ';')

0 commit comments

Comments
 (0)