# terminate early on dirty repository
! git diff --quiet --exit-code . && [ "$1" != "--dry-run" ] && {
  echo "!!!!!Dirty repository. Exiting...!!!!!"
  exit 1
} >&2

if [ "$1" != "--dry-run" ]; then
  # shellcheck disable=SC2312
  git pull && git add . \
    && git commit -m "$(date -Iseconds)" \
    && git push origin master \
    || echo "nothing to commit :)"
fi
