#!/usr/bin/env bash

files=`git status --porcelain | wc -l`
if [ ${files} == 0 ] ; then
    echo "No changes detected. Running pre-push hooks..."
    .githooks/pre-commit || { echo "FAIL"; exit 1; }
else
    echo "Changes detected. Please commit or stash them."
    git status
    exit 1
fi
