#!/bin/bash

SCRIPT=$(readlink -f "$0")      # Absolute path to this script (work with links!)
SCRIPTPATH=$(dirname "$SCRIPT") # Absolute dir path to this script

pushd .

cd $SCRIPTPATH/..

echo "Syncing Notes"
git pull

echo ""
echo "Staging changed files"
git add .

echo ""
echo "Committing staged files"
git commit -m "Sync Notes - $(date)"

echo ""
echo "Pushing changes to the git repository"
git push

echo ""
echo "Finished syncing"

popd