Skip to content

Commit 3017cc9

Browse files
committed
Use null delimiters in xargs to support space in file names
1 parent 76ff8fd commit 3017cc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

formatter.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let
2626
deadnix --no-lambda-pattern-names --edit "$@"
2727
2828
# Use git to traverse since nixfmt doesn't have good traversal
29-
git ls-files "$@" | grep '\.nix$' | xargs --no-run-if-empty nixfmt
29+
git ls-files -z "$@" | grep --null '\.nix$' | xargs --null --no-run-if-empty nixfmt
3030
'';
3131

3232
meta = {

lib/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ let
467467
fi
468468
469469
# Use git to traverse since nixfmt doesn't have good traversal
470-
git ls-files "$@" | grep '\.nix$' | xargs --no-run-if-empty nixfmt
470+
git ls-files -z "$@" | grep --null '\.nix$' | xargs --null --no-run-if-empty nixfmt
471471
'';
472472
})
473473
);

0 commit comments

Comments
 (0)