[install] Improve error message

This commit is contained in:
Junegunn Choi 2015-08-19 19:42:06 +09:00
parent 55d566b72f
commit 1c31e07d34

19
install
View File

@ -21,16 +21,21 @@ ask() {
check_binary() {
echo -n " - Checking fzf executable ... "
local output=$("$fzf_base"/bin/fzf --version 2>&1)
if [ "$version" = "$output" ]; then
local output
output=$("$fzf_base"/bin/fzf --version 2>&1)
if [ $? -ne 0 ]; then
echo "Error: $output"
binary_error="Invalid binary"
elif [ "$version" != "$output" ]; then
echo "$output != $version"
binary_error="Invalid version"
else
echo "$output"
binary_error=""
else
echo "$output != $version"
rm -f "$fzf_base"/bin/fzf
binary_error="Invalid binary"
return 1
return 0
fi
rm -f "$fzf_base"/bin/fzf
return 1
}
symlink() {