mirror of
https://github.com/jorgebucaran/fisher
synced 2024-07-02 23:11:48 +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
|
function _fisher_self_uninstall
|
||||||
set -l current_pkgs $fisher_config/*/*/*
|
set -l current_pkgs $fisher_config/*/*/*
|
||||||
set -l removed_pkgs (_fisher_pkg_remove_all $current_pkgs)
|
for path in $fisher_cache (_fisher_pkg_remove_all $current_pkgs) $fisher_config $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile
|
||||||
printf "removing %s\n" $removed_pkgs $fisher_config $fisher_cache $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile | command sed "s|$HOME|~|"
|
echo "removing $path"
|
||||||
|
command rm -rf $path 2>/dev/null
|
||||||
command rm -rf $fisher_config $fisher_cache 2>/dev/null
|
end | command sed "s|$HOME|~|" >&2
|
||||||
command rm $fisher_path/{functions,completions}/fisher.fish $fish_config/fishfile 2>/dev/null
|
|
||||||
|
|
||||||
set -e fisher_cache
|
set -e fisher_cache
|
||||||
set -e fisher_config
|
set -e fisher_config
|
||||||
|
@ -144,6 +143,8 @@ function _fisher_self_uninstall
|
||||||
|
|
||||||
complete -c fisher --erase
|
complete -c fisher --erase
|
||||||
functions -e (functions -a | command awk '/^_fisher/') fisher
|
functions -e (functions -a | command awk '/^_fisher/') fisher
|
||||||
|
|
||||||
|
echo "done -- see you again!" >&2
|
||||||
end
|
end
|
||||||
|
|
||||||
function _fisher_commit
|
function _fisher_commit
|
||||||
|
|
Loading…
Reference in a new issue