Skip to content

Commit

Permalink
Refactor fish_plugins write logic for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebucaran committed Jun 17, 2022
1 parent cf4c6cc commit 5622dd6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions functions/fisher.fish
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"

command rm -rf $source_plugins

set --query _fisher_plugins[1] || set --erase _fisher_plugins
set --query _fisher_plugins &&
printf "%s\n" $_fisher_plugins >$fish_plugins ||
if set --query _fisher_plugins[1]
printf "%s\n" $_fisher_plugins >$fish_plugins
else
set --erase _fisher_plugins
command rm -f $fish_plugins
end

set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
test "$total" != "0 0 0" && echo (string join ", " (
Expand Down

0 comments on commit 5622dd6

Please sign in to comment.