mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 04:45:14 +00:00
parent
a9a29dff4f
commit
6439a138fe
36
install
36
install
@ -9,6 +9,7 @@ auto_completion=
|
|||||||
key_bindings=
|
key_bindings=
|
||||||
update_config=2
|
update_config=2
|
||||||
binary_arch=
|
binary_arch=
|
||||||
|
allow_legacy=
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@ -37,6 +38,7 @@ for opt in "$@"; do
|
|||||||
auto_completion=1
|
auto_completion=1
|
||||||
key_bindings=1
|
key_bindings=1
|
||||||
update_config=1
|
update_config=1
|
||||||
|
allow_legacy=1
|
||||||
;;
|
;;
|
||||||
--key-bindings) key_bindings=1 ;;
|
--key-bindings) key_bindings=1 ;;
|
||||||
--no-key-bindings) key_bindings=0 ;;
|
--no-key-bindings) key_bindings=0 ;;
|
||||||
@ -165,6 +167,9 @@ case "$archi" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
install_ruby_fzf() {
|
install_ruby_fzf() {
|
||||||
|
if [ -z "$allow_legacy" ]; then
|
||||||
|
ask "Do you want to install legacy Ruby version instead?" && exit 1
|
||||||
|
fi
|
||||||
echo "Installing legacy Ruby version ..."
|
echo "Installing legacy Ruby version ..."
|
||||||
|
|
||||||
# ruby executable
|
# ruby executable
|
||||||
@ -236,26 +241,25 @@ cd "$fzf_base"
|
|||||||
if [ -n "$binary_error" ]; then
|
if [ -n "$binary_error" ]; then
|
||||||
if [ $binary_available -eq 0 ]; then
|
if [ $binary_available -eq 0 ]; then
|
||||||
echo "No prebuilt binary for $archi ..."
|
echo "No prebuilt binary for $archi ..."
|
||||||
if command -v go > /dev/null; then
|
else
|
||||||
echo -n "Building binary (go get -u github.com/junegunn/fzf/src/fzf) ... "
|
echo " - $binary_error !!!"
|
||||||
if [ -z "${GOPATH-}" ]; then
|
fi
|
||||||
export GOPATH="${TMPDIR:-/tmp}/fzf-gopath"
|
if command -v go > /dev/null; then
|
||||||
mkdir -p "$GOPATH"
|
echo -n "Building binary (go get -u github.com/junegunn/fzf/src/fzf) ... "
|
||||||
fi
|
if [ -z "${GOPATH-}" ]; then
|
||||||
if go get -u github.com/junegunn/fzf/src/fzf; then
|
export GOPATH="${TMPDIR:-/tmp}/fzf-gopath"
|
||||||
echo "OK"
|
mkdir -p "$GOPATH"
|
||||||
cp "$GOPATH/bin/fzf" "$fzf_base/bin/"
|
fi
|
||||||
else
|
if go get -u github.com/junegunn/fzf/src/fzf; then
|
||||||
echo "Failed to build binary ..."
|
echo "OK"
|
||||||
install_ruby_fzf
|
cp "$GOPATH/bin/fzf" "$fzf_base/bin/"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "go executable not found. Cannot build binary ..."
|
echo "Failed to build binary ..."
|
||||||
install_ruby_fzf
|
install_ruby_fzf
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo " - $binary_error !!!"
|
echo "go executable not found. Cannot build binary ..."
|
||||||
exit 1
|
install_ruby_fzf
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user