Last active
May 27, 2018 14:03
-
-
Save jechol/912acf710b02954676045b5dd9eadc23 to your computer and use it in GitHub Desktop.
pre-commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
pushd .git/hooks > /dev/null | |
curl -s -O https://gist.githubusercontent.com/jechol/912acf710b02954676045b5dd9eadc23/raw/71e01f0c0f4f45c97805bbabfa6d24ce64fd8fe2/pre-commit | |
chmod a+x pre-commit | |
popd > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd `git rev-parse --show-toplevel` | |
mix format --check-formatted | |
if [ $? == 1 ]; then | |
echo "[ERROR!!!] Commit failed because you have format issues..." | |
echo "[SO WHAT?] Please run mix format and git add/commit again dude. ^^" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment