From 7356d199abfad2316f6b6dcf6274709f540e26f0 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 4 Mar 2023 19:36:48 +0100 Subject: [PATCH] feat(octoeverywhere): remove store dir during uninstall Signed-off-by: Dominik Willner --- scripts/octoeverywhere.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/octoeverywhere.sh b/scripts/octoeverywhere.sh index 79e05ac..1185603 100644 --- a/scripts/octoeverywhere.sh +++ b/scripts/octoeverywhere.sh @@ -234,6 +234,19 @@ function remove_octoeverywhere_config() { fi } +function remove_octoeverywhere_store_dir() { + local files regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/octoeverywhere-store" + files=$(find "${HOME}" -maxdepth 2 -type d -regextype posix-extended -regex "${regex}" | sort) + + if [[ -n ${files} ]]; then + for file in ${files}; do + status_msg "Removing ${file} ..." + rm -rf "${file}" + ok_msg "${file} removed!" + done + fi +} + function remove_octoeverywhere_env() { [[ ! -d "${HOME}octoeverywhere-env" ]] && return @@ -249,6 +262,7 @@ function remove_octoeverywhere() remove_octoeverywhere_dir remove_octoeverywhere_env remove_octoeverywhere_config + remove_octoeverywhere_store_dir print_confirm "OctoEverywhere was successfully removed!" return