Skip to content

Commit

Permalink
skip installation if there's no .git
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 20, 2022
1 parent f66b4ab commit a6fc3ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/pre-commit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ in
if ! type -t git >/dev/null; then
# This happens in pure shells, including lorri
echo 1>&2 "WARNING: pre-commit-hooks.nix: git command not found; skipping installation."
elif [[ ! -f .git ]]; then
echo 1>&2 "WARNING: pre-commit-hooks.nix: .git not found; skipping installation."
else
# These update procedures compare before they write, to avoid
# filesystem churn. This improves performance with watch tools like lorri
Expand Down

0 comments on commit a6fc3ff

Please sign in to comment.