#!/bin/sh

# assumes ./org directory with org files to publish to 
# ./html

#target=$(readlink -f $1)

if [ ! -d "./org" ]; then
    echo "no org directory"
    exit
fi


dir=`pwd`

emacs  \
-l /home/r/config/emacs/clojure-init.el \
-l /home/r/config/emacs/org-init.el \
-l /home/r/config/emacs/web-color.el \
--batch \
--eval "
(progn
(setq org-publish-project-alist
      '(
	(\"project\"
	 :base-directory \"$dir/org\"
	 :base-extension \"org\"
	 :publishing-directory \"$dir/html\"
	 :recursive t
	 :publishing-function org-publish-org-to-html
	 :auto-preamble t)
	))

(org-publish-project \"project\"))" \
\
2>&1 #| pcregrep 'Wrote'




