mirror of
https://github.com/jorgebucaran/fisher
synced 2024-06-28 23:01:50 +02:00
refactor: dry self-uninstall; add farewell message
This commit is contained in:
parent
56131b66dc
commit
8f42f7abdf
11
fisher.fish
11
fisher.fish
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue