summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-04-12 01:57:05 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-04-12 01:57:56 +0900
commit348731fc3b1e3a8f653522c39e61f78ffc7967fb (patch)
treece3cc06ab3db5894633d7ead7255688cc2a68410 /bin
parent797f42ecc614f732080de70b1006616f435de4f0 (diff)
Make fzf-tmux work when fzf is not in $PATH but in the same directory
See: #181
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fzf-tmux4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux
index f1fcb091..55ea5f76 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")"