From 148ef7e3ed53f987b9dbe10ad989ecc58f7d86c5 Mon Sep 17 00:00:00 2001 From: deicidus Date: Fri, 16 Jun 2023 02:36:14 -0700 Subject: [PATCH] fixed progression --- spells/menu/bitcoin/uninstall-bitcoin | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spells/menu/bitcoin/uninstall-bitcoin b/spells/menu/bitcoin/uninstall-bitcoin index 694699e..9ea7f1c 100755 --- a/spells/menu/bitcoin/uninstall-bitcoin +++ b/spells/menu/bitcoin/uninstall-bitcoin @@ -21,8 +21,6 @@ uninstall_bitcoin_from_source() { make_directory=$(dirname "$(find / -name "Makefile.in" 2>/dev/null | grep "bitcoin")") if [ -n "$make_directory" ]; then cd "$make_directory" && sudo make uninstall > /dev/null 2>&1 - else - return 1 fi } @@ -43,23 +41,27 @@ uninstall_bitcoin_package() { # Detect the operating system's package manager if command -v apt &> /dev/null; then if is_deb_package_installed bitcoin; then - sudo apt-get remove -y bitcoin + sudo apt remove -y bitcoin + return 0 fi elif command -v dnf &> /dev/null; then if is_rpm_package_installed bitcoin; then sudo dnf remove -y bitcoin + return 0 fi elif command -v pacman &> /dev/null; then if is_arch_package_installed bitcoin; then sudo pacman -Rns bitcoin --noconfirm + return 0 fi elif command -v brew &> /dev/null; then if brew list --cask bitcoin-core; then brew uninstall --cask bitcoin-core + return 0 fi else echo "Unsupported package manager" - exit 1 + return 1 fi } @@ -68,7 +70,9 @@ uninstall_bitcoin() { read -p "This will uninstall Bitcoin Core and might delete your wallet data. Are you sure? (Y/n) " yn case $yn in [Yy]* ) - uninstall_bitcoin_package || uninstall_bitcoin_from_source || remove_bitcoin_binaries + if ! uninstall_bitcoin_package && ! uninstall_bitcoin_from_source; then + remove_bitcoin_binaries + fi ;; [Nn]* ) echo "Uninstallation cancelled"