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.
This commit is contained in:
Jorge Bucaran 2016-03-15 22:13:29 +09:00
parent 2587ca9aeb
commit b4caade4fd

View File

@ -89,7 +89,7 @@ function fisher_install -d "Install plugins"
else else
if test ! -s $fisher_cache/.index 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" debug "Update index ok"
else else
debug "Update index fail" debug "Update index fail"
@ -101,10 +101,14 @@ function fisher_install -d "Install plugins"
printf "%s\t%s\n" $url $item printf "%s\t%s\n" $url $item
else if functions -q "$item" else if functions -q "$item"
set -l path (__fisher_function_to_plugin $item) set -l path
if set path (__fisher_function_to_plugin $item)
printf "%s\t%s" "$path" $item printf "%s\t%s" "$path" $item
else else
printf "fisher: '%s' not found or index out of date.\n" $item > $stderr printf "fisher: '%s' is a directory in %s.\n" $item $PWD > $stderr
end
else
printf "fisher: I couldn't find '%s' in the index.\n" $item > $stderr
end end
end end
end end