Detect the system when OS is Windows_NT (#7989)

Since we assume only Windows would set this value, we just run OS detection rather than trying to normalize it to `windows`.
This commit is contained in:
denusklo
2026-09-09 04:47:04 +08:00
committed by GitHub
parent 53692fd9fd
commit 9d72dceac6

View File

@@ -49,7 +49,10 @@ if [[ ! ${ARCH-} ]]; then
export ARCH export ARCH
fi fi
if [[ ! ${OS-} ]]; then # Windows predefines OS as Windows_NT for every process, so on a windows shell
# the check below would always find a value and never call os(). That is not a
# name this build knows, so it does not count as one the caller chose.
if [[ ! ${OS-} || ${OS-} == "Windows_NT" ]]; then
OS=$(os) OS=$(os)
export OS export OS
fi fi