diff options
| author | EuAndreh <eu@euandre.org> | 2021-02-03 09:17:51 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2021-02-03 09:18:04 -0300 |
| commit | dcf9c266d43e5a84981bf51e97275aca3072a955 (patch) | |
| tree | 3e750dc735b961a393fd3ab314e759655795c99f | |
| parent | fake-symlinks: Add tests/lib.sh (diff) | |
| download | dotfiles-dcf9c266d43e5a84981bf51e97275aca3072a955.tar.gz dotfiles-dcf9c266d43e5a84981bf51e97275aca3072a955.tar.xz | |
assert-nixfmt.sh: Only run when nixfmt is available
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 2 | ||||
| -rwxr-xr-x | aux/assert-nixfmt.sh | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -2,7 +2,7 @@ check: sh aux/assert-shellcheck.sh sh aux/assert-todos.sh - sh aux/assert-nixfmt.sh ||: + sh aux/assert-nixfmt.sh sh sh/templates/aux/assert-clang-format.sh .PHONY: clean diff --git a/aux/assert-nixfmt.sh b/aux/assert-nixfmt.sh index 19bd0a2a..72d4a8af 100755 --- a/aux/assert-nixfmt.sh +++ b/aux/assert-nixfmt.sh @@ -1,6 +1,11 @@ #!/bin/sh set -eux +if ! type nixfmt; then + echo 'Missing nixfmt, skipping test' >&2 + exit 0 +fi + # shellcheck disable=2016 find . -type f -name '*.nix' -print0 | xargs -0 -I{} sh -c ' nixfmt < "$1" | diff - "$1" || { |
