#!/bin/bash
set -e
cd ~/Documents/github/rightmove

# Only commit if there are changes

if git diff --quiet && git diff --staged --quiet; then
	echo "$(date): No changes to commit"
	exit 0
fi

git add -A
git commit -m "Daily scrape $(date +%Y-%m-%d)"
git push
echo "$(date): Push successful"
