diff options
author | Spaxly <[email protected]> | 2021-12-02 09:17:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-02 10:17:23 +0100 |
commit | 79d673edbc177ce3550d906bb921cb78189a60c8 (patch) | |
tree | 4e753c438ddf73cb960f1ab24c88fa3f5ca90991 /utils/installer/uninstall.sh | |
parent | 77bf0e3ea8caf18dcb687ab432eee94c14fd5b08 (diff) |
feat: add some messages in uninstall.sh (#1945)
Co-authored-by: kylo252 <[email protected]>
Diffstat (limited to 'utils/installer/uninstall.sh')
-rwxr-xr-x | utils/installer/uninstall.sh | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 31007984..236d657f 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -13,8 +13,6 @@ declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" # TODO: Use a dedicated cache directory #1256 declare -r LUNARVIM_CACHE_DIR="$XDG_CACHE_HOME/nvim" -LVIM_BIN="$(which lvim 2>/dev/null)" - declare -a __lvim_dirs=( "$LUNARVIM_CONFIG_DIR" "$LUNARVIM_RUNTIME_DIR" @@ -44,15 +42,33 @@ function parse_arguments() { done } -function main() { - parse_arguments "$@" +function remove_lvim_dirs() { for dir in "${__lvim_dirs[@]}"; do rm -rf "$dir" if [ "$ARGS_REMOVE_BACKUPS" -eq 1 ]; then rm -rf "$dir.bak" fi done - rm -f "$LVIM_BIN" +} + +function remove_lvim_bin() { + local legacy_bin="/usr/local/bin/lvim " + if [ -x "$legacy_bin" ]; then + echo "Error! Unable to remove $legacy_bin without elevation. Please remove manually." + exit 1 + fi + + lvim_bin="$(command -v lvim 2>/dev/null)" + rm -f "$lvim_bin" +} + +function main() { + parse_arguments "$@" + echo "Removing LunarVim binary..." + remove_lvim_bin + echo "Removing LunarVim directories..." + remove_lvim_dirs + echo "Uninstalled LunarVim!" } main "$@" |