make sure working tree is clean before execution

This commit is contained in:
Arne Morten Kvarving 2017-01-18 11:30:45 +01:00
parent 532faf8f72
commit ab66125297

View File

@ -44,6 +44,17 @@ SCRIPT_PATH=`getAbsPath "$SCRIPT_PATH"`
OPM_DATA=
WORKSPACE="$SCRIPT_PATH/.."
# Make sure the working tree is clean
pushd . > /dev/null
cd $WORKSPACE
if [[ -n $(git diff-files) ]]
then
echo "Cannot run with working tree changes. Commit, drop or stash them."
exit 1
fi
popd > /dev/null
if [ "$OSTYPE" == "linux-gnu" ]
then
if which nproc > /dev/null