mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
Detect Ubuntu by checking release() and uname() (#13704)
This will improve detection of Ubuntu when running on Ubuntu on WSL. #13703
This commit is contained in:
@@ -156,7 +156,9 @@ proc detectOsImpl(d: Distribution): bool =
|
||||
of Distribution.Posix: result = defined(posix)
|
||||
of Distribution.MacOSX: result = defined(macosx)
|
||||
of Distribution.Linux: result = defined(linux)
|
||||
of Distribution.Ubuntu, Distribution.Gentoo, Distribution.FreeBSD,
|
||||
of Distribution.Ubuntu:
|
||||
result = "Ubuntu" in release() or ("-" & $d & " ") in uname()
|
||||
of Distribution.Gentoo, Distribution.FreeBSD,
|
||||
Distribution.OpenBSD:
|
||||
result = ("-" & $d & " ") in uname()
|
||||
of Distribution.RedHat:
|
||||
|
||||
Reference in New Issue
Block a user