scripts/svn-diff-editor
author Tomas Zeman <tzeman@volny.cz>
Tue, 09 Jan 2018 12:28:15 +0100
changeset 52 c0d94e64d89a
parent 40 7b691c3bba6c
permissions -rwxr-xr-x
window-title: set terminal title

#!/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"