From 74ad599dda282d29d75bcce9c60a5b875def51de Mon Sep 17 00:00:00 2001 From: opalmay Date: Fri, 17 Feb 2023 14:27:15 +0200 Subject: refactor: uninstaller --- utils/installer/uninstall.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 96dea8cd..0ac62e36 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -6,14 +6,14 @@ 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"}" -declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" -declare -r LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}" -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 -xr NVIM_APPNAME="${NVIM_APPNAME:-"lvim"}" + +declare LUNARVIM_DATA_DIR="$XDG_DATA_HOME/$NVIM_APPNAME" +declare LUNARVIM_CACHE_DIR="$XDG_CACHE_HOME/$NVIM_APPNAME" declare -a __lvim_dirs=( - "$LUNARVIM_RUNTIME_DIR" + "$LUNARVIM_DATA_DIR" "$LUNARVIM_CACHE_DIR" ) @@ -59,19 +59,18 @@ function remove_lvim_dirs() { } function remove_lvim_bin() { - local legacy_bin="/usr/local/bin/lvim " + 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)" + lvim_bin="$(command -v $NVIM_APPNAME 2>/dev/null)" rm -f "$lvim_bin" } function remove_desktop_file() { OS="$(uname -s)" - # TODO: Any other OSes that use desktop files? ([ "$OS" != "Linux" ] || ! command -v xdg-desktop-menu &>/dev/null) && return echo "Removing desktop file..." -- cgit v1.2.3