Skip to content
Myr

Update install script to try "go get ..."

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 1b9ca31 · Browse files · 1 file+35 added−14 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Related: #470, #497

Diff stats

1 file+35 added−14 removed

  • other:+35 added−14 removed

1 file+35 added−14 removed

modified:install+35 added-14 removed
100 unmodified lines
101 return 1102 fi103}104105link_fzf_in_path() {106 if which_fzf="$(which fzf 2> /dev/null)"; then107 echo " - Found in \$PATH"108 echo " - Creating symlink: $which_fzf -> bin/fzf"109 (cd "$fzf_base"/bin && rm -f fzf && ln -sf "$which_fzf" fzf)110 check_binary && return111 fi112 return 1113}114115download() {116 echo "Downloading bin/fzf ..."117 if [ $pre = 0 ]; then118 if [ -x "$fzf_base"/bin/fzf ]; then
2 unmodified lines
121 fi122 if [ -x "$fzf_base"/bin/$1 ]; then123 symlink $1 && check_binary && return124 fi115 if which_fzf="$(which fzf 2> /dev/null)"; then116 echo " - Found in \$PATH"117 echo " - Creating symlink: $which_fzf -> bin/fzf"118 (cd "$fzf_base"/bin && rm -f fzf && ln -sf "$which_fzf" fzf)119 check_binary && return120 fi125 link_fzf_in_path && return126 fi127 mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin128 if [ $? -ne 0 ]; then129 binary_error="Failed to create bin directory"
29 unmodified lines
159 Linux\ i*86) download fzf-$version-linux_${binary_arch:-386} ;;160 *) binary_available=0 binary_error=1 ;;161esac162158cd "$fzf_base"159if [ -n "$binary_error" ]; then160 if [ $binary_available -eq 0 ]; then161 echo "No prebuilt binary for $archi ... "162 else163 echo " - $binary_error !!!"164 exit 1165 fi163install_ruby_fzf() {164 echo "Installing legacy Ruby version ..."165166 # ruby executable167 echo -n "Checking Ruby executable ... "
57 unmodified lines
225 echo "#!/bin/sh" > "$fzf_base"/bin/fzf226 echo "$fzf_cmd \"\$@\"" >> "$fzf_base"/bin/fzf227 chmod +x "$fzf_base"/bin/fzf228 echo "OK"229}230231cd "$fzf_base"232if [ -n "$binary_error" ]; then233 if [ $binary_available -eq 0 ]; then234 echo "No prebuilt binary for $archi ..."235 if which go > /dev/null 2>&1; then236 echo -n "Building binary (go get github.com/junegunn/fzf/src/fzf) ... "237 if go get github.com/junegunn/fzf/src/fzf; then238 echo "OK"239 link_fzf_in_path240 else241 echo "Failed to build binary ..."242 install_ruby_fzf243 fi244 else245 echo "go executable not found. Cannot build binary ..."246 install_ruby_fzf247 fi248 else249 echo " - $binary_error !!!"250 exit 1251 fi252fi253254[[ "$*" =~ "--bin" ]] && exit 0255
136 unmodified lines