summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-13 02:39:00 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-13 02:39:00 +0900
commit5c491d573a147573c68aa7e56a6032dbe4b84635 (patch)
tree7592ee476e8fbcc925dbe3fdf62029288af09c72 /install
parent2c86e728b56a54304f4a4404f14a678b5279adc9 (diff)
Fix fzf.{bash,zsh} when Go version is not supported
Diffstat (limited to 'install')
-rwxr-xr-xinstall30
1 files changed, 20 insertions, 10 deletions
diff --git a/install b/install
index f8307cf3..4098c87b 100755
--- a/install
+++ b/install
@@ -152,20 +152,29 @@ for shell in bash zsh; do
fzf_completion="# $fzf_completion"
fi
- cat > $src << EOF
+ if [ -n "$binary_error" ]; then
+ cat > $src << EOF
# Setup fzf function
# ------------------
unalias fzf 2> /dev/null
+fzf() {
+ $fzf_cmd "\$@"
+}
+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 [ -x "$fzf_base/bin/fzf" ]; then
- if [[ ! "\$PATH" =~ "$fzf_base/bin" ]]; then
- export PATH="$fzf_base/bin:\$PATH"
- fi
-else
- fzf() {
- $fzf_cmd "\$@"
- }
- export -f fzf > /dev/null
+if [[ ! "\$PATH" =~ "$fzf_base/bin" ]]; then
+ export PATH="$fzf_base/bin:\$PATH"
fi
# Auto-completion
@@ -173,6 +182,7 @@ fi
$fzf_completion
EOF
+ fi
if [ $key_bindings -eq 0 ]; then
if [ $shell = bash ]; then