Update core.func

This commit is contained in:
CanbiZ 2025-07-04 13:34:35 +02:00
parent 83915c1168
commit 6a28e4c09e

View File

@ -262,19 +262,16 @@ ensure_tput() {
} }
is_alpine() { is_alpine() {
local os_id="${var_os:-}" local os_id="${var_os:-${PCT_OSTYPE:-}}"
if [[ -z "$os_id" ]]; then if [[ -z "$os_id" && -f /etc/os-release ]]; then
if [[ -f /etc/os-release ]]; then os_id="$(
os_id="$( . /etc/os-release 2>/dev/null
. /etc/os-release 2>/dev/null echo "${ID:-}"
echo "${ID:-}" )"
)"
fi
fi fi
echo "[DEBUG] is_alpine(): os_id='${os_id}'" >&2 [[ "${DEBUG:-}" == "true" ]] && echo "[DEBUG] is_alpine(): os_id='${os_id}'" >&2
[[ "$os_id" == "alpine" ]] [[ "$os_id" == "alpine" ]]
} }