Commit bb908495 authored by Maxime Brunet's avatar Maxime Brunet Committed by Marc Cornellà
Browse files

fzf: Fix shell directory for archlinux package (#7119)

* fzf: Fix shell directory for archlinux package

* fzf: Don't clutter PATH if fzf already available

* brew has it available via symlink in /usr/local/bin
* Fedora and Arch packages have it place in /usr/bin

* fzf: Fix archlinux guess by using release file

* fzf: unset leftover variables
parent f73c29a8
...@@ -24,22 +24,29 @@ fi ...@@ -24,22 +24,29 @@ fi
if [[ -n "${fzf_base}" ]]; then if [[ -n "${fzf_base}" ]]; then
# Fix fzf shell directory for Archlinux package
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
fzf_shell="${fzf_base}"
else
fzf_shell="${fzf_base}/shell"
fi
# Setup fzf # Setup fzf
# --------- # ---------
if [[ ! "$PATH" == *$fzf_base/bin* ]]; then if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then
export PATH="$PATH:$fzf_base/bin" export PATH="$PATH:$fzf_base/bin"
fi fi
# Auto-completion # Auto-completion
# --------------- # ---------------
if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then
[[ $- == *i* ]] && source "$fzf_base/shell/completion.zsh" 2> /dev/null [[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null
fi fi
# Key bindings # Key bindings
# ------------ # ------------
if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then
source "$fzf_base/shell/key-bindings.zsh" source "${fzf_shell}/key-bindings.zsh"
fi fi
else else
...@@ -47,4 +54,4 @@ else ...@@ -47,4 +54,4 @@ else
"Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2
fi fi
unset fzf_base unset fzf_base fzf_shell dir fzfdirs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment