From: John Ellson Date: Fri, 16 Jan 2015 14:33:49 +0000 (-0500) Subject: use if set X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~129^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=076bb41452a1ffc1dbc7abd959701e3f78fb39d1;p=graphviz use if set --- diff --git a/plugin/xlib/vimdot.sh b/plugin/xlib/vimdot.sh index 4e6dd4bb4..cd40fccbc 100755 --- a/plugin/xlib/vimdot.sh +++ b/plugin/xlib/vimdot.sh @@ -3,9 +3,11 @@ error() { echo "$0: $*" >&2; exit 1; } -editor="vim" - -if ! test -x "$(command -v "$editor")"; then error "the \"$editor\" editor not found or not executable"; fi +# Try $EDITOR first, else try vim or vi +editor="$EDITOR" +[ -x "$editor" ] || editor="/usr/bin/vim" +[ -x "$editor" ] || editor="/usr/bin/vi" +[ -x "$editor" ] || error "EDITOR not found or not executable"; default="noname.gv"