Updates install-meta.sh and miseExec.sh for metawizard

This commit is contained in:
Matheus Albino Brunhara
2024-12-06 12:30:58 -03:00
parent f05d0ab44c
commit f55f1e3e29
2 changed files with 27 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/env bash
show_help() {
echo "Usage: $(basename $0) [--preset|-p] [--executable|-e] [--dry-run|-d]"
echo "Usage: $(basename $0) [--preset|-p] [--executable|-e] [--dry-run|-d] [--help|h]"
echo "Options:"
echo " --help | -h (Optional) Display help information on how to use this script"
echo " --preset | -p (Optional) Disables interactive preset selection and runs it"
@@ -44,6 +44,7 @@ MISE_TOOL_MAVEN_3_9_9="3.9.9"
FILENAME_GP_DEBUGPORTS="debugports-01.sh"
FILENAME_GEOSERVER="runstandalone.sh"
FILENAME_METAWIZARD="metawizard.sh"
list_presets() {
echo "Choose one of the presets:"
@@ -51,7 +52,8 @@ list_presets() {
echo " 2. Run GeoServer with Java 8"
echo " 3. Run GeoServer with Java 11"
echo " 4. Run Maven 3.3.3 with Java 8"
echo " 4. Run Maven 3.8.4 with Java 11"
echo " 5. Run Maven 3.8.4 with Java 11"
echo " 6. Run MetaWizard with Java 8"
}
read_preset_input() {
@@ -64,21 +66,23 @@ set_executable_filename_if_it_is_null() {
select_preset_by_input() {
case "$SELECTED_PRESET" in
"1")
"1" | "2")
set_executable_filename_if_it_is_null "$FILENAME_GP_DEBUGPORTS"
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8")
;;
"2")
set_executable_filename_if_it_is_null "$FILENAME_GP_DEBUGPORTS"
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11")
;;
"3")
set_executable_filename_if_it_is_null "$FILENAME_GEOSERVER"
MISE_TOOLS=("java$MISE_TOOL_JAVA_8" "maven@$MISE_TOOL_MAVEN_3_3_3")
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_3_3")
;;
"4")
set_executable_filename_if_it_is_null "$FILENAME_GEOSERVER"
MISE_TOOLS=("java$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_9_9")
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8" "maven@$MISE_TOOL_MAVEN_3_9_9")
;;
"5")
MISE_TOOLS=("java@$MISE_TOOL_JAVA_11" "maven@$MISE_TOOL_MAVEN_3_9_9")
;;
"6")
set_executable_filename_if_it_is_null "$FILENAME_METAWIZARD"
MISE_TOOLS=("java@$MISE_TOOL_JAVA_8")
;;
esac
}
@@ -102,6 +106,7 @@ if [ ! -f "$EXECUTABLE_FILENAME" ]; then
exit 1
fi
# TODO, EXECUTABLE_FILENAME for maven options
COMMAND_TO_RUN=("mise" "exec" "${MISE_TOOLS[@]}" "--" "$EXECUTABLE_FILENAME")
[[ "$SHOULD_DRY_RUN" == true ]] && COMMAND_TO_RUN=("echo" "${COMMAND_TO_RUN[@]}")