#! /bin/bash
git stash -q --keep-index

if [ -x $(which grunt) ]; then
    grunt build
    RESULT=$?
    [ $RESULT -ne 0 ] && exit 1

    git add assets/install_swiftype.js assets/install_swiftype.min.js
else
    echo "ERROR: install grunt (npm install -g grunt)"
fi

git stash pop -q
