Procházet zdrojové kódy

chore(git-hook): don't fail commit hook when no mix

William Yang před 2 roky
rodič
revize
caf8d43d24
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      scripts/git-hook-pre-commit.sh

+ 1 - 1
scripts/git-hook-pre-commit.sh

@@ -5,7 +5,7 @@ set -euo pipefail
 OPT="${1:--c}"
 OPT="${1:--c}"
 
 
 # mix format check is quite fast
 # 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_dirty="$(git diff --name-only | grep -E '.*\.erl' || true)"
 files_cached="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"
 files_cached="$(git diff --cached --name-only | grep -E '.*\.erl' || true)"