fix: JDK missing if this platform is not targeted

This commit is contained in:
Serge Guzik 2019-02-12 21:57:33 +02:00
parent 79f07a5e01
commit 4a955c78f4

10
warp4j
View File

@ -242,6 +242,14 @@ function choose_distro_type() {
# actually choose distro type
JAVA_DISTRO_TYPE=$(choose_distro_type)
# even if this platform is not targeted, we still need
# a JDK for this platform to optimize JDKs for other platforms
TARGETS_TO_CACHE=${TARGETS[@]}
if [[ $JAVA_DISTRO_TYPE == $DISTRO_TYPE_JDK ]] && # if usind JDK (not JRE)
[[ ${TARGETS[@]} != *"$THIS_PLATFORM"* ]]; then # and this platform is not targeted
TARGETS_TO_CACHE+=($THIS_PLATFORM)
fi
# choose cache path for this platform
case $THIS_PLATFORM in
$MAC) CACHE_PATH="$HOME/Library/Application Support/warp4j" ;;
@ -453,7 +461,7 @@ function ensure_distro_cached() {
}
# actually ensure required distro is in cache
for target in ${TARGETS[@]}; do
for target in ${TARGETS_TO_CACHE[@]}; do
ensure_distro_cached $target
done