From 348731fc3b1e3a8f653522c39e61f78ffc7967fb Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 12 Apr 2015 01:57:05 +0900 Subject: [PATCH] Make fzf-tmux work when fzf is not in $PATH but in the same directory See: #181 --- bin/fzf-tmux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/fzf-tmux b/bin/fzf-tmux index f1fcb09..55ea5f7 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -106,7 +106,9 @@ fail() { >&2 echo "$1" exit 1 } -fzf=$(which fzf 2> /dev/null) || fail "fzf executable not found" +fzf="$(which fzf 2> /dev/null)" || fzf="$(dirname "$0")/fzf" +[ -x "$fzf" ] || fail "fzf executable not found" + envs="" [ -n "$FZF_DEFAULT_OPTS" ] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")" [ -n "$FZF_DEFAULT_COMMAND" ] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"