From f1766dcfa01f55b42213df4e501d57d7749b3344 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Sat, 12 Jan 2019 19:10:04 +0900 Subject: [PATCH] refactor: automate erasing variables in uninstall --- README.md | 2 +- fisher.fish | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2bb31dc..8a4db86 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ end ## Uninstalling -You want to know how to uninstall Fisher and everything you've installed with it from your system. This command will purge all packages, cache, configuration and related files—all in the same session. +You want to know how to uninstall Fisher and everything you've installed with it from your system. This command will purge all packages, cache, configuration and related files. ```fish fisher self-uninstall diff --git a/fisher.fish b/fisher.fish index d5f87b8..5976a11 100644 --- a/fisher.fish +++ b/fisher.fish @@ -188,10 +188,9 @@ function _fisher_self_uninstall command rm -Rf $file 2>/dev/null end | command sed "s|$HOME|~|" >&2 - set -e fisher_cache - set -e fisher_config - set -e fisher_path - set -e fisher_version + for name in (set -n | command awk '/^fisher_/') + set -e "$name" + end complete -c fisher --erase functions -e (functions -a | command awk '/^_fisher/') fisher