From 95a083a6f4ac29786e1d65593e2d5b7354744d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Fri, 6 Jun 2025 16:52:28 +0200 Subject: [PATCH] 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 --- tools/rebar3-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rebar3-format.sh b/tools/rebar3-format.sh index d83d8e803..2181b6870 100755 --- a/tools/rebar3-format.sh +++ b/tools/rebar3-format.sh @@ -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" '{}' ';')