#! /bin/sh
( . /sw/bin/init.sh
  cd $HOME/projects/kanbun/mecab-kanbun
  git pull .
  D=incoming/$USER/hakubun
  mkdir -p $D
  for F
  do B=`basename $F`
     if [ ! -s $D/$B ]
     then cp `ls -1t incoming/*/[th]*/$B | head -1` $D/$B
     fi
     open -t $D/$B
     rm -f $D/$B'~'
     git add .
     git commit -am $D/$B
  done
  git push origin master
) > $HOME/hakubun.log 2>&1
exit 0
