fs2json: directory structure -> json object converter.
E.g. to be used instead of erica / py-Couchapp (interaction with couchdb is left to the user).
#!/bin/sh
case "${EDITOR}" in
"")
EDITOR="vi"
;;
emacs)
EDITOR="$EDITOR -nw"
;;
gvim|vim)
EDITOR="$EDITOR -f -o"
;;
esac
SVNTMP="$1"
cleanup_exit() {
rm -rf "$SVNTMP"
}
# Remove temporary files even if we get interrupted
trap "cleanup_exit" 0 # normal exit
trap "exit 255" HUP INT QUIT ABRT TERM
#echo >> "$2"
#cat "$1" >> "$2"
#rm "$1"
$EDITOR "$2" "$1"