From: Bjørn Forsman Date: Tue, 6 Jan 2015 19:39:41 +0000 (+0100) Subject: vimdot: lookup 'vim' in $PATH X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~129^2~5^2~2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2008bf62e13ebe41cdad3e16f8b42f46ae393876;p=graphviz vimdot: lookup 'vim' in $PATH Instead of hardcoding /usr/bin/vim. Needed for NixOS (http://nixos.org), and is probably useful for others too. --- diff --git a/plugin/xlib/vimdot.sh b/plugin/xlib/vimdot.sh index 749fe6a38..4e6dd4bb4 100755 --- a/plugin/xlib/vimdot.sh +++ b/plugin/xlib/vimdot.sh @@ -3,9 +3,9 @@ error() { echo "$0: $*" >&2; exit 1; } -editor="/usr/bin/vim" +editor="vim" -if ! test -x "$editor"; then error "the \"$editor\" editor not found or not executable"; fi +if ! test -x "$(command -v "$editor")"; then error "the \"$editor\" editor not found or not executable"; fi default="noname.gv"