From cf7457a067f7878f46e818cff8d7fdc1680564ed Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Tue, 15 Mar 2016 22:13:29 +0900 Subject: [PATCH] Don't install the entire index. Handle the case when the user tries to install a plugin that is a function, but a directory of the same name already exists in the current working directory. --- functions/fisher_install.fish | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/functions/fisher_install.fish b/functions/fisher_install.fish index aa86319..fbb065a 100644 --- a/functions/fisher_install.fish +++ b/functions/fisher_install.fish @@ -89,7 +89,7 @@ function fisher_install -d "Install plugins" else if test ! -s $fisher_cache/.index - if spin "__fisher_index_update" --error=/dev/null -f " @\r" > /dev/null + if spin "__fisher_index_update" --error=/dev/null > /dev/null debug "Update index ok" else debug "Update index fail" @@ -101,10 +101,14 @@ function fisher_install -d "Install plugins" printf "%s\t%s\n" $url $item else if functions -q "$item" - set -l path (__fisher_function_to_plugin $item) - printf "%s\t%s" "$path" $item + set -l path + if set path (__fisher_function_to_plugin $item) + printf "%s\t%s" "$path" $item + else + printf "fisher: '%s' is a directory in %s.\n" $item $PWD > $stderr + end else - printf "fisher: '%s' not found or index out of date.\n" $item > $stderr + printf "fisher: I couldn't find '%s' in the index.\n" $item > $stderr end end end