#!/bin/bash # # Install Pomander as a pre-commit hook set -e git rev-parse --is-inside-work-tree &> /dev/null if [[ "$?" > 0 ]]; then echo "Pomander install failed: Not a git repository" exit 1 fi ROOT_DIR=$(git rev-parse --show-toplevel) cd $ROOT_DIR cd "$ROOT_DIR/.git/hooks" rm -f pre-commit curl -sS https://raw.githubusercontent.com/mementologists/pomander/test/lintAndTest/bin/lint_and_test > pre-commit chmod +x pre-commit echo "Lint and Test Ready to go!" cd $ROOT_DIR if [ ! -d "pomHooks" ] ; then mkdir pomHooks ; fi cd pomHooks curl -sS https://raw.githubusercontent.com/mementologists/pomander/test/lintAndTest/bin/pomander > pomander chmod +x pomander echo "Pomander Ready to go!" curl -sS https://raw.githubusercontent.com/mementologists/pomander/test/lintAndTest/bin/run_tests > run_tests chmod +x run_tests echo "Run Test Ready to go!" exit 0