From 1344762dcb6e6b1e8a9e095ffb6f21d62799ab09 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Wed, 16 Mar 2016 14:43:07 +0900 Subject: [PATCH] Skip plugin update if there are no plugins to update. --- functions/fisher_update.fish | 50 +++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/functions/fisher_update.fish b/functions/fisher_update.fish index 1046530..48198cd 100644 --- a/functions/fisher_update.fish +++ b/functions/fisher_update.fish @@ -87,37 +87,39 @@ function fisher_update -d "Update plugins" set -l total (count $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 - set -l name (printf "%s\n" $path | __fisher_name) + for path in $plugins + set -l name (printf "%s\n" $path | __fisher_name) - if test ! -L $path - debug "Update start %s" "$name" - fish -ic " - spin ' - if __fisher_path_update $path - set fisher_updated_plugins \$fisher_updated_plugins $name - printf \"%s\n\" \"$indicator $name\" - end + if test ! -L $path + debug "Update start %s" "$name" + fish -ic " + spin ' + if __fisher_path_update $path + set fisher_updated_plugins \$fisher_updated_plugins $name + printf \"%s\n\" \"$indicator $name\" + end - ' -f \" $color@$color_normal\r\" - " & + ' -f \" $color@$color_normal\r\" + " & + end end - end - while true - set -l has_jobs (jobs) - if test -z "$has_jobs" - break + while true + set -l has_jobs (jobs) + if test -z "$has_jobs" + break + end end - end - for plugin in $fisher_updated_plugins - set -l path (__fisher_path_from_plugin) - if __fisher_plugin_can_enable "$plugin" "$path" - debug "Enable %s" "$plugin" - __fisher_plugin_enable "$plugin" "$path" + for plugin in $fisher_updated_plugins + set -l path (__fisher_path_from_plugin) + if __fisher_plugin_can_enable "$plugin" "$path" + debug "Enable %s" "$plugin" + __fisher_plugin_enable "$plugin" "$path" + end end end