├── Readme.md └── pre-commit /Readme.md: -------------------------------------------------------------------------------- 1 | # Hooks 2 | 3 | GIT hooks that I use, which is really only just one :) a poor-mans CI to ensure your master branch always passes. 4 | 5 | ## One-liner 6 | 7 | ```bash 8 | curl -sL https://github.com/tj/hooks/archive/master.tar.gz | tar xz --strip-components=1 -C $(git rev-parse --show-toplevel)/.git/hooks/ 9 | ``` 10 | 11 | ## Badges 12 | 13 | ![](https://img.shields.io/badge/license-MIT-blue.svg) 14 | ![](https://img.shields.io/badge/status-stable-green.svg) 15 | [![](http://apex.sh/images/badge.svg)](https://apex.sh/ping/) 16 | 17 | --- 18 | 19 | > [tjholowaychuk.com](http://tjholowaychuk.com)  ·  20 | > GitHub [@tj](https://github.com/tj)  ·  21 | > Twitter [@tjholowaychuk](https://twitter.com/tjholowaychuk) 22 | -------------------------------------------------------------------------------- /pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Hook: pre-commit 4 | # Desc: run tests on master branch 5 | 6 | branch=`git rev-parse --abbrev-ref HEAD` 7 | 8 | if [ "$branch" = "master" ]; then 9 | make test 10 | fi 11 | --------------------------------------------------------------------------------