#!/bin/bash
# note - Edit the Gallimaufry of Whits
# Author: Sean B. Palmer, inamidst.com

cd ~/web/inamidst.com/www/whits

NOTE=$(date +%Y/%m.txt)
if [[ ! -f $NOTE ]]
then echo "Please create $NOTE first..." >&2
     exit 1
fi

if [[ -n $(tail -n 1 $NOTE) ]]
then echo >> $NOTE
fi

date -u '+%Y-%m-%d %H:%M UTC: ' >> $NOTE
echo >> $NOTE
emacs +$(wc -l $NOTE | awk '{print $1 + 1}') $NOTE

# EOF
