refactor: dry self-uninstall; add farewell message

This commit is contained in:
Jorge Bucaran 2018-10-06 12:01:20 +09:00
parent 56131b66dc
commit 8f42f7abdf
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30

View file

@ -131,11 +131,10 @@ end
function _fisher_self_uninstall
set -l current_pkgs $fisher_config/*/*/*
set -l removed_pkgs (_fisher_pkg_remove_all $current_pkgs)
printf "removing %s\n" $removed_pkgs $fisher_config $fisher_cache $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile | command sed "s|$HOME|~|"
command rm -rf $fisher_config $fisher_cache 2>/dev/null
command rm $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile 2>/dev/null
for path in $fisher_cache (_fisher_pkg_remove_all $current_pkgs) $fisher_config $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile
echo "removing $path"
command rm -rf $path 2>/dev/null
end | command sed "s|$HOME|~|" >&2
set -e fisher_cache
set -e fisher_config
@ -144,6 +143,8 @@ function _fisher_self_uninstall
complete -c fisher --erase
functions -e (functions -a | command awk '/^_fisher/') fisher
echo "done -- see you again!" >&2
end
function _fisher_commit