From 07d47ec38949ffb85f661e8d9c01f1441f0bca37 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 2 Jun 2024 21:16:17 +0200 Subject: [PATCH] [DO NOT UPDATE] Prepare for file structure changes --- bin/updater | 5 +++- uninstall.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/bin/updater b/bin/updater index 41853ee1..6968f563 100755 --- a/bin/updater +++ b/bin/updater @@ -5,13 +5,16 @@ cd "${HOME}/.dotfiles" || ( ) # Define updater version -UPDATER_VERSION=2 +UPDATER_VERSION=3 case "${STAGE}" in 1) echo ":: 1 | Unlinking files" ./uninstall.sh + [[ -z "${UPDATER_VERSION}" ]] || [[ ! "${UPDATER_VERSION}" -gt "2" ]] && + ./uninstall.sh --remove-legacy-paths + echo ":: 1 | Linking files" ./install.sh diff --git a/uninstall.sh b/uninstall.sh index 2518f21d..25747e9f 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -15,6 +15,75 @@ function unlink() { # install bit [[ -n "$REMOVE_INSTALLBIT" ]] && rm -rf "$HOME/.config/.jstm_dotfiles" +for arg in "${@}"; do + case "${arg}" in + "--remove-legacy-paths") + echo ":: Unlinking legacy paths" + + declare -a legacypaths=( + ".local/bin/jobrunner" + ".local/bin/jobrunner-runjob" + ".jstmbash" + ".config/jstmbash.env" + ".config/starship.toml" + ".bashrc" + ".config/hypr" + ".config/waybar" + ".config/fnott" + ".config/eww" + ".config/xdg-desktop-portal/hyprland-portals.conf" + ".config/neofetch" + ".config/btop" + ".local/share/mc" + ".config/mc" + ".config/mpv" + ".config/GIMP/2.10/splashes" + ".config/gitui" + ".local/share/mc/skins/dracula.ini" + ".local/share/mc/skins/dracula256.ini" + ".config/nwg-look" + ".config/qt5ct" + ".config/qt6ct" + ".config/Kvantum" + ".icons" + ".local/share/icons" + ".fonts" + ".config/fontconfig" + ".local/share/wallpapers" + ".local/share/plasma" + ".config/kdedefaults" + ".local/share/color-schemes" + ".local/share/aurorae" + ".config/kglobalshortcutsrc" + ".config/kiorc" + ".config/krunnerrc" + ".config/kservicemenurc" + ".config/ksplashrc" + ".config/ktimezonedrc" + ".config/plasma-localrc" + ".config/plasma-org.kde.plasma.deskop-appletsrc" + ".config/konsolerc" + ".local/share/konsole" + ".config/dolphinrc" + ".local/bin/dotfiles-updatechecker" + ".local/bin/dotfiles-updater" + ".local/bin/dotfiles-install-software" + ".config/copyq" + ) + + for path in "${legacypaths[@]}"; do + unlink "${path}" + done + + echo ":: Unlinked legacy paths" + exit 1 + ;; + *) + echo ":: Warning: Unknown argument \"${arg}\"" + ;; + esac +done + # jobrunner unlink ".local/bin/jobrunner" unlink ".local/bin/jobrunner-runjob"