From c729f1fb9bb59f07ce62c2d63e2ed3f6977bdf5d Mon Sep 17 00:00:00 2001 From: bryan Date: Mon, 2 Jun 2025 16:16:12 -0400 Subject: [PATCH] Allow --uninstall to be used seamlessly before other operations --- installJRMC | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/installJRMC b/installJRMC index 74357b7..871f2bd 100755 --- a/installJRMC +++ b/installJRMC @@ -208,7 +208,7 @@ parse_input() { err "Incorrect option provided, see installJRMC --help"; exit 1 fi - # Fallback to default install method in some scenarios + # Set some default conditions if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH || CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) && [[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then @@ -220,10 +220,6 @@ parse_input() { echo "Warning: not all repositories have beta channels" echo "If the MC package is unavailable, try using --mcrepo to select another repository" fi - - # if [[ -n $CONTAINER_INSTALL_SWITCH ]] && ((LOCAL_INSTALL_SWITCH || REPO_INSTALL_SWITCH)); then - # err "Some --install methods are incompatible" - # fi } # @description Perform OS detection and generate OS-specific functions @@ -1751,6 +1747,13 @@ main() { ((UNINSTALL_SWITCH)) && uninstall + # Exit now if only --uninstall is passed + if ! (( BUILD_SWITCH || CREATEREPO_SWITCH || REPO_INSTALL_SWITCH || LOCAL_INSTALL_SWITCH || + CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH )) && + [[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then + exit 0 + fi + install_external_repos if ((REPO_INSTALL_SWITCH)); then