Added logic to skip --noconsole on newer versions

Fixes #452
This commit is contained in:
Geoff Bourne 2020-04-13 18:29:44 -05:00
parent 1c2a0c506c
commit 8dbbdd8cd2
2 changed files with 16 additions and 1 deletions

View File

@ -80,7 +80,7 @@ esac
EXTRA_ARGS=""
# Optional disable console
if [[ ${CONSOLE} = false || ${CONSOLE} = FALSE ]]; then
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
EXTRA_ARGS+="--noconsole"
fi

View File

@ -63,3 +63,18 @@ function normalizeMemSize {
val=${1:0: -1}
echo $(( val * scale ))
}
function versionLessThan {
local activeParts
IFS=. read -ra activeParts <<< "${VANILLA_VERSION}"
local givenParts
IFS=. read -ra givenParts <<< "$1"
if (( activeParts[0] < givenParts[0] )) || \
(( activeParts[0] == givenParts[0] && activeParts[1] < givenParts[1] )); then
return 0
else
return 1
fi
}