#!/bin/bash
./check
if [ $? -eq 1 ]; then
    echo "Check Failed"
    exit 1
fi

git add .

#if ! git diff --exit-code
if `git status | grep -q "nothing to commit"`; then
    echo "no files to commit"
else
    git commit -v -s
    if [ $? -eq 1 ]; then
        # most likely empty message
        echo "Exiting, commit failed"
        exit 2
    fi
fi
