diff options
author | Vaisakh K M <[email protected]> | 2022-11-22 09:56:20 +0530 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-21 23:26:20 -0500 |
commit | 40ec8a0e6a28bff877dd0deae5c2faecac0d1390 (patch) | |
tree | 463c553a55301e2b05464dbd9a941f1740531ec8 /utils | |
parent | 6132a30dff8808d4c9f0dc046daf2991f58adf1e (diff) |
fix(uninstaller): add separate flag to remove user config (#3508)
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/installer/uninstall.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 597bbf85..8a7256f0 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -2,6 +2,7 @@ set -eo pipefail ARGS_REMOVE_BACKUPS=0 +ARGS_REMOVE_CONFIG=0 declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" @@ -12,16 +13,18 @@ declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" declare -r LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}" declare -a __lvim_dirs=( - "$LUNARVIM_CONFIG_DIR" "$LUNARVIM_RUNTIME_DIR" "$LUNARVIM_CACHE_DIR" ) +__lvim_config_dir="$LUNARVIM_CONFIG_DIR" + function usage() { echo "Usage: uninstall.sh [<options>]" echo "" echo "Options:" echo " -h, --help Print this help message" + echo " --remove-config Remove old backup folders as well" echo " --remove-backups Remove old backup folders as well" } @@ -31,6 +34,9 @@ function parse_arguments() { --remove-backups) ARGS_REMOVE_BACKUPS=1 ;; + --remove-config) + ARGS_REMOVE_CONFIG=1 + ;; -h | --help) usage exit 0 @@ -41,6 +47,9 @@ function parse_arguments() { } function remove_lvim_dirs() { + if [ "$ARGS_REMOVE_CONFIG" -eq 1 ]; then + __lvim_dirs+=($__lvim_config_dir) + fi for dir in "${__lvim_dirs[@]}"; do rm -rf "$dir" if [ "$ARGS_REMOVE_BACKUPS" -eq 1 ]; then |