Skip plugin update if there are no plugins to update.

This commit is contained in:
Jorge Bucaran 2016-03-16 14:43:07 +09:00
parent 712cd07bff
commit 1344762dcb
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30

View file

@ -87,37 +87,39 @@ function fisher_update -d "Update plugins"
set -l total (count $plugins) set -l total (count $plugins)
set -U fisher_updated_plugins set -U fisher_updated_plugins
printf "Updating plugins...\n" $name > $stderr if set -q plugins[1]
printf "Updating plugins...\n" $name > $stderr
for path in $plugins for path in $plugins
set -l name (printf "%s\n" $path | __fisher_name) set -l name (printf "%s\n" $path | __fisher_name)
if test ! -L $path if test ! -L $path
debug "Update start %s" "$name" debug "Update start %s" "$name"
fish -ic " fish -ic "
spin ' spin '
if __fisher_path_update $path if __fisher_path_update $path
set fisher_updated_plugins \$fisher_updated_plugins $name set fisher_updated_plugins \$fisher_updated_plugins $name
printf \"%s\n\" \"$indicator $name\" printf \"%s\n\" \"$indicator $name\"
end end
' -f \" $color@$color_normal\r\" ' -f \" $color@$color_normal\r\"
" & " &
end
end end
end
while true while true
set -l has_jobs (jobs) set -l has_jobs (jobs)
if test -z "$has_jobs" if test -z "$has_jobs"
break break
end
end end
end
for plugin in $fisher_updated_plugins for plugin in $fisher_updated_plugins
set -l path (__fisher_path_from_plugin) set -l path (__fisher_path_from_plugin)
if __fisher_plugin_can_enable "$plugin" "$path" if __fisher_plugin_can_enable "$plugin" "$path"
debug "Enable %s" "$plugin" debug "Enable %s" "$plugin"
__fisher_plugin_enable "$plugin" "$path" __fisher_plugin_enable "$plugin" "$path"
end
end end
end end