scripts/svn-diff-editor
author Tomas Zeman <tomas@functionals.cz>
Tue, 15 Dec 2020 09:22:21 +0100
changeset 60 4267602e8494
parent 40 7b691c3bba6c
permissions -rwxr-xr-x
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"