From caf8d43d24bafbaed4fd6dfc1d024373119a83c6 Mon Sep 17 00:00:00 2001 From: William Yang Date: Fri, 5 May 2023 11:02:58 +0200 Subject: [PATCH] chore(git-hook): don't fail commit hook when no mix --- scripts/git-hook-pre-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/git-hook-pre-commit.sh b/scripts/git-hook-pre-commit.sh index cebd92b22..aeb8186cf 100755 --- a/scripts/git-hook-pre-commit.sh +++ b/scripts/git-hook-pre-commit.sh @@ -5,7 +5,7 @@ set -euo pipefail OPT="${1:--c}" # mix format check is quite fast -mix format --check-formatted +which mix && mix format --check-formatted files_dirty="$(git diff --name-only | grep -E '.*\.erl' || true)" files_cached="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"