summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-17 20:40:00 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-17 20:40:00 +0900
commita3101120fddd16eaef39e120d9e5678f46d28897 (patch)
tree0af634a3c413271f6bc7161d778516d41bba3343
parent30f9651f9957d20dfb1b43ddc3ae77bae8c3ac59 (diff)
Update install script0.9.1
-rwxr-xr-xinstall10
1 files changed, 7 insertions, 3 deletions
diff --git a/install b/install
index edcad66f..b0164267 100755
--- a/install
+++ b/install
@@ -16,6 +16,7 @@ check_binary() {
local output=$("$fzf_base"/bin/fzf --version 2>&1)
if [ "$version" = "$output" ]; then
echo "$output"
+ binary_error=""
else
echo "$output != $version"
rm -f "$fzf_base"/bin/fzf
@@ -27,8 +28,12 @@ check_binary() {
symlink() {
echo " - Creating symlink: bin/$1 -> bin/fzf"
(cd "$fzf_base"/bin &&
- rm -f fzf
+ rm -f fzf &&
ln -sf $1 fzf)
+ if [ $? -ne 0 ]; then
+ binary_error="Failed to create symlink"
+ return 1
+ fi
}
download() {
@@ -37,8 +42,7 @@ download() {
echo " - Already exists"
check_binary && return
elif [ -x "$fzf_base"/bin/$1 ]; then
- symlink $1
- check_binary && return
+ symlink $1 && check_binary && return
fi
mkdir -p "$fzf_base"/bin && cd "$fzf_base"/bin
if [ $? -ne 0 ]; then