diff options
author | Hayden <hayden@whitewaterfoundry.com> | 2020-03-20 05:59:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 10:59:05 +0100 |
commit | f4dbdd311fbb3dd99dafca2179f17f2747531b4f (patch) | |
tree | 523499c32799312a7514cce09407e8383f4c43d1 | |
parent | dae9865b14fffd98ca0ef20517500831169861e7 (diff) | |
download | Nim-f4dbdd311fbb3dd99dafca2179f17f2747531b4f.tar.gz |
Detect Ubuntu by checking release() and uname() (#13704)
This will improve detection of Ubuntu when running on Ubuntu on WSL. #13703
-rw-r--r-- | lib/pure/distros.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/distros.nim b/lib/pure/distros.nim index 63cfe6719..8d4fbc857 100644 --- a/lib/pure/distros.nim +++ b/lib/pure/distros.nim @@ -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: |