1. disable fish as not packaged and creates broken symlinks 1. disabled download as we pre-package 1. fix paths to completions --- fzf-0.34.0/install~ 2022-09-30 09:21:44.085976824 +0300 +++ fzf-0.34.0/install 2022-09-30 09:29:08.782477314 +0300 @@ -6,7 +6,7 @@ auto_completion= key_bindings= update_config=2 -shells="bash zsh fish" +shells="bash zsh" prefix='~/.fzf' prefix_expand=~/.fzf fish_dir=${XDG_CONFIG_HOME:-$HOME/.config}/fish @@ -163,8 +163,9 @@ chmod +x fzf && check_binary } -# Try to download binary executable archi=$(uname -sm) +download() { +# Try to download binary executable binary_available=1 binary_error="" case "$archi" in @@ -184,6 +185,10 @@ Windows*\ *64) download fzf-$version-windows_amd64.zip ;; *) binary_available=0 binary_error=1 ;; esac +} + +# pre-packaged, so always true +binary_available=1 binary_error="" cd "$fzf_base" if [ -n "$binary_error" ]; then @@ -247,12 +252,12 @@ src=${prefix_expand}.${shell} echo -n "Generate $src ... " - fzf_completion="[[ \$- == *i* ]] && source \"$fzf_base/shell/completion.${shell}\" 2> /dev/null" + fzf_completion="[[ \$- == *i* ]] && source \"/usr/share/fzf/completion.${shell}\" 2> /dev/null" if [ $auto_completion -eq 0 ]; then fzf_completion="# $fzf_completion" fi - fzf_key_bindings="source \"$fzf_base/shell/key-bindings.${shell}\"" + fzf_key_bindings="source \"/usr/share/fzf/key-bindings.${shell}\"" if [ $key_bindings -eq 0 ]; then fzf_key_bindings="# $fzf_key_bindings" fi @@ -260,9 +265,6 @@ cat > "$src" << EOF # Setup fzf # --------- -if [[ ! "\$PATH" == *$fzf_base_esc/bin* ]]; then - PATH="\${PATH:+\${PATH}:}$fzf_base/bin" -fi # Auto-completion # --------------- @@ -288,7 +290,7 @@ fish_binding="${fish_dir}/functions/fzf_key_bindings.fish" if [ $key_bindings -ne 0 ]; then echo -n "Symlink $fish_binding ... " - ln -sf "$fzf_base/shell/key-bindings.fish" \ + ln -sf "/usr/share/fzf/key-bindings.fish" \ "$fish_binding" && echo "OK" || echo "Failed" else echo -n "Removing $fish_binding ... "