last_commit_date=`git log -1 --format=%cd | head -c 10`
current_date=`date | head -c 10`
if [ "$last_commit_date" !=  "$current_date" ]; then
    git config --global user.email "weecologydeploy@weecology.org"
    git config --global user.name "Weecology Deploy Bot"

    git checkout master
    git add predictions/* docs/*
    git commit -m "Update forecasts: Travis Build $TRAVIS_BUILD_NUMBER"

    git remote add deploy https://${GITHUB_TOKEN}@github.com/weecology/portalPredictions.git > /dev/null 2>&1
    git push --quiet deploy master > /dev/null 2>&1
fi

last_commit_date=`git log --author='Weecology Deploy Bot' -1 --format=%cd | head -c 10`
current_date=`date | head -c 10`
if [ "$last_commit_date" !=  "$current_date" ]; then
    git config --global user.email "weecologydeploy@weecology.org"
    git config --global user.name "Weecology Deploy Bot"

    git checkout master
    git add predictions/* docs/*
    git commit -m "Update forecasts: Travis Build $TRAVIS_BUILD_NUMBER"

    git remote add deploy https://${GITHUB_TOKEN}@github.com/weecology/portalPredictions.git > /dev/null 2>&1
    git push --quiet deploy master > /dev/null 2>&1
fi

Fix last deploy date check
Fix last deploy date check

The check to prevent multiple updates of forecasts in a single day was
failing because on new changes the last commit is by definition on the
same day as the build. This checks for the last commit by the deploy bot
instead.
