Allow --uninstall to be used seamlessly before other operations
This commit is contained in:
13
installJRMC
13
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
|
||||
|
||||
Reference in New Issue
Block a user