Fixed bug causing isTrue to fail (#1727)

This commit is contained in:
Geoff Bourne
2022-09-10 14:39:44 -05:00
committed by GitHub
parent fabe14db49
commit a1e4657e62
2 changed files with 11 additions and 10 deletions
+9 -6
View File
@@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
: "${DEBUG_EXEC:=false}"
: "${SETUP_ONLY:=false}"
# shellcheck source=start-utils # shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils" . "${SCRIPTS:-/}start-utils"
isDebugging && set -x isDebugging && set -x
@@ -234,7 +237,7 @@ if [[ ${TYPE} == "CURSEFORGE" && "${SERVER}" ]]; then
cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1) cd "${FTB_DIR}" || (log "ERROR: can't go into ${FTB_DIR}"; exit 1)
log "Starting CurseForge server in ${FTB_DIR}..." log "Starting CurseForge server in ${FTB_DIR}..."
if isTrue ${DEBUG_EXEC}; then if isTrue "${DEBUG_EXEC}"; then
set -x set -x
fi fi
exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${SERVER}")" "$@" $EXTRA_ARGS exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${SERVER}")" "$@" $EXTRA_ARGS
@@ -259,15 +262,15 @@ EOF
finalArgs="${FTB_SERVER_START}" finalArgs="${FTB_SERVER_START}"
if isTrue "${SETUP_ONLY:=false}"; then if isTrue "${SETUP_ONLY}"; then
echo "SETUP_ONLY: ${finalArgs}" echo "SETUP_ONLY: ${finalArgs}"
exit exit
fi fi
if isTrue ${DEBUG_EXEC}; then if isTrue "${DEBUG_EXEC}"; then
set -x set -x
fi fi
if isTrue ${EXEC_DIRECTLY:-false}; then if isTrue "${EXEC_DIRECTLY:-false}"; then
"${finalArgs[@]}" "${finalArgs[@]}"
else else
exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}" exec mc-server-runner "${mcServerRunnerArgs[@]}" "${finalArgs[@]}"
@@ -275,7 +278,7 @@ EOF
elif [[ $SERVER =~ run.sh ]]; then elif [[ $SERVER =~ run.sh ]]; then
log "Using Forge supplied run.sh script..." log "Using Forge supplied run.sh script..."
echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt echo $JVM_XX_OPTS $JVM_OPTS $expandedDOpts > user_jvm_args.txt
if isTrue ${SETUP_ONLY:=false}; then if isTrue ${SETUP_ONLY}; then
echo "SETUP_ONLY: bash ${SERVER}" echo "SETUP_ONLY: bash ${SERVER}"
exit exit
fi fi
@@ -296,7 +299,7 @@ else
"$@" $EXTRA_ARGS "$@" $EXTRA_ARGS
) )
if isTrue ${SETUP_ONLY:=false}; then if isTrue ${SETUP_ONLY}; then
echo "SETUP_ONLY: java ${finalArgs[*]}" echo "SETUP_ONLY: java ${finalArgs[*]}"
exit exit
fi fi
+2 -4
View File
@@ -63,8 +63,7 @@ function getFilenameFromUrl() {
} }
function isTrue() { function isTrue() {
local arg="${1?}" case "${1,,}" in
case ${arg,,} in
true | on | 1) true | on | 1)
return 0 return 0
;; ;;
@@ -75,8 +74,7 @@ function isTrue() {
} }
function isFalse() { function isFalse() {
local arg="${1?}" case "${1,,}" in
case ${arg,,} in
false | off | 0) false | off | 0)
return 0 return 0
;; ;;