m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Update install/build script from Homebrew

This commit is contained in:
Junegunn Choi
2015-01-13 23:46:38 +09:00
parent b8c4b35415
commit a3068a33d5
5 changed files with 49 additions and 18 deletions

15
install
View File

@@ -13,9 +13,14 @@ ask() {
check_binary() {
echo -n " - Checking fzf executable ... "
if ! "$fzf_base"/bin/fzf --version; then
local output=$("$fzf_base"/bin/fzf --version 2>&1)
if [ "$version" = "$output" ]; then
echo "$output"
else
echo "$output != $version"
rm -f "$fzf_base"/bin/fzf
binary_error="Error occurred"
binary_error="Invalid binary"
return 1
fi
}
@@ -27,9 +32,11 @@ symlink() {
}
download() {
echo "Downloading bin/$1 ..."
if [ -x "$fzf_base"/bin/$1 ]; then
echo "Downloading bin/fzf ..."
if [ -x "$fzf_base"/bin/fzf ]; then
echo " - Already exists"
check_binary && return
elif [ -x "$fzf_base"/bin/$1 ]; then
symlink $1
check_binary && return
fi