Have formatters for each file run in parallel

This commit is contained in:
Archit Gupta 2023-08-28 19:57:26 -07:00
parent 84162f4098
commit e5db2dcd86

View File

@ -20,14 +20,15 @@ in
PATH=${lib.makeBinPath (config.devShell.packages pkgs)} PATH=${lib.makeBinPath (config.devShell.packages pkgs)}
for f in "$@"; do for f in "$@"; do
if [ -d "$f" ]; then if [ -d "$f" ]; then
${fd}/bin/fd "$f" -Htf -x "$0" ${fd}/bin/fd "$f" -Htf -x "$0" &
else else
case "$(${coreutils}/bin/basename "$f")" in case "$(${coreutils}/bin/basename "$f")" in
${toString (mapAttrsToList ${toString (mapAttrsToList
(n: v: "${n}) ${v} \"$f\";;") (config.formatters pkgs))} (n: v: "${n}) ${v} \"$f\" & ;;") (config.formatters pkgs))}
esac esac
fi fi
done &>/dev/null done &>/dev/null
wait
''; '';
}; };