bootstrap/specs/mix/template/.githooks/pre-commit

14 lines
232 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -e
filesToFormat=$(
git --no-pager diff --name-status --no-color --cached | \
awk '$1 != "D" && $2 ~ /\.exs?$/ {print $NF}'
)
for path in $filesToFormat
do
mix format "$path"
git add "$path"
done