Update tools.func
This commit is contained in:
parent
5552a2beb4
commit
e6b42a2b86
@ -2791,8 +2791,10 @@ function setup_java() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate INSTALLED_VERSION is not empty if matched
|
# Validate INSTALLED_VERSION is not empty if matched
|
||||||
local JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || echo "0")
|
local JDK_COUNT
|
||||||
if [[ -z "$INSTALLED_VERSION" && "$JDK_COUNT" -gt 0 ]]; then
|
JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || echo "0")
|
||||||
|
JDK_COUNT=${JDK_COUNT//[^0-9]/} # Remove any non-numeric characters
|
||||||
|
if [[ -z "$INSTALLED_VERSION" && "${JDK_COUNT:-0}" -gt 0 ]]; then
|
||||||
msg_warn "Found Temurin JDK but cannot determine version"
|
msg_warn "Found Temurin JDK but cannot determine version"
|
||||||
INSTALLED_VERSION="0"
|
INSTALLED_VERSION="0"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user