Allow --uninstall to be used seamlessly before other operations

This commit is contained in:
2025-06-02 16:16:12 -04:00
parent cc7c1d4c5f
commit c729f1fb9b

View File

@@ -208,7 +208,7 @@ parse_input() {
err "Incorrect option provided, see installJRMC --help"; exit 1 err "Incorrect option provided, see installJRMC --help"; exit 1
fi fi
# Fallback to default install method in some scenarios # Set some default conditions
if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH
|| CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) && || CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) &&
[[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then [[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then
@@ -220,10 +220,6 @@ parse_input() {
echo "Warning: not all repositories have beta channels" echo "Warning: not all repositories have beta channels"
echo "If the MC package is unavailable, try using --mcrepo to select another repository" echo "If the MC package is unavailable, try using --mcrepo to select another repository"
fi 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 # @description Perform OS detection and generate OS-specific functions
@@ -1751,6 +1747,13 @@ main() {
((UNINSTALL_SWITCH)) && uninstall ((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 install_external_repos
if ((REPO_INSTALL_SWITCH)); then if ((REPO_INSTALL_SWITCH)); then