#!/bin/sh
# assumes that there is a ./org directory, and tangles
# each org file in it.

DIR=`pwd`
FILES=""

for i in $(find $DIR/org -name "*.org"); do
    FILES="$FILES \"$i\""
done


emacs  --batch  \
-l /home/r/config/emacs/clojure-init.el \
-l /home/r/config/emacs/org-init.el \
--eval "(progn
(mapc (lambda (file)
       (find-file (expand-file-name file \"$DIR\"))
       (org-babel-tangle)
       (kill-buffer)) '($FILES)))" 
