Skip to content

Commit

Permalink
Support passing files and directories as arguments to nixfmt-plus script
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers authored and flexiondotorg committed Nov 6, 2024
1 parent c9cdaf8 commit 5a70f07
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions home-manager/_mixins/scripts/nixfmt-plus/nixfmt-plus.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env bash
set -eou pipefail

deadnix --edit
statix fix
nixfmt --verify .
if [ $# -eq 0 ]; then
deadnix --edit
statix fix
nixfmt --verify .
else
deadnix --edit "$@"
for target in "$@"; do
statix fix -- "$target"
done
nixfmt --verify "$@"
fi

0 comments on commit 5a70f07

Please sign in to comment.