mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 06:07:42 +00:00
Fix fzf.{bash,zsh} when Go version is not supported
This commit is contained in:
parent
2c86e728b5
commit
5c491d573a
22
install
22
install
@ -152,20 +152,29 @@ for shell in bash zsh; do
|
|||||||
fzf_completion="# $fzf_completion"
|
fzf_completion="# $fzf_completion"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$binary_error" ]; then
|
||||||
cat > $src << EOF
|
cat > $src << EOF
|
||||||
# Setup fzf function
|
# Setup fzf function
|
||||||
# ------------------
|
# ------------------
|
||||||
unalias fzf 2> /dev/null
|
unalias fzf 2> /dev/null
|
||||||
unset fzf 2> /dev/null
|
|
||||||
if [ -x "$fzf_base/bin/fzf" ]; then
|
|
||||||
if [[ ! "\$PATH" =~ "$fzf_base/bin" ]]; then
|
|
||||||
export PATH="$fzf_base/bin:\$PATH"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
fzf() {
|
fzf() {
|
||||||
$fzf_cmd "\$@"
|
$fzf_cmd "\$@"
|
||||||
}
|
}
|
||||||
export -f fzf > /dev/null
|
export -f fzf > /dev/null
|
||||||
|
|
||||||
|
# Auto-completion
|
||||||
|
# ---------------
|
||||||
|
$fzf_completion
|
||||||
|
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat > $src << EOF
|
||||||
|
# Setup fzf
|
||||||
|
# ---------
|
||||||
|
unalias fzf 2> /dev/null
|
||||||
|
unset fzf 2> /dev/null
|
||||||
|
if [[ ! "\$PATH" =~ "$fzf_base/bin" ]]; then
|
||||||
|
export PATH="$fzf_base/bin:\$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Auto-completion
|
# Auto-completion
|
||||||
@ -173,6 +182,7 @@ fi
|
|||||||
$fzf_completion
|
$fzf_completion
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $key_bindings -eq 0 ]; then
|
if [ $key_bindings -eq 0 ]; then
|
||||||
if [ $shell = bash ]; then
|
if [ $shell = bash ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user