scripts/svn-diff-editor
author Tomas Zeman <tomas@functionals.cz>
Mon, 27 Apr 2020 22:23:42 +0200
changeset 58 b36c5ed3c360
parent 40 7b691c3bba6c
permissions -rwxr-xr-x
.bashrc.t450

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