diff --git a/scripts/platform.cake b/scripts/platform.cake index 2338675b81..31e1ef8d8e 100644 --- a/scripts/platform.cake +++ b/scripts/platform.cake @@ -105,11 +105,23 @@ public sealed class Platform private static void ReadDistroNameAndVersion(out string distroName, out Version version) { - var lines = System.IO.File.ReadAllLines("/etc/os-release"); - distroName = null; version = null; + string OS_Release_Path = "/etc/os-release"; + + if (!System.IO.File.Exists(OS_Release_Path)) + { + OS_Release_Path = "/usr/lib/os-release"; + } + + if (!System.IO.File.Exists(OS_Release_Path)) + { + return; + } + + var lines = System.IO.File.ReadAllLines(OS_Release_Path); + foreach (var line in lines) { var equalsIndex = line.IndexOf('='); diff --git a/src/OmniSharp.Shared/Utilities/Platform.cs b/src/OmniSharp.Shared/Utilities/Platform.cs index 2b9eda18f7..1a483e57e9 100644 --- a/src/OmniSharp.Shared/Utilities/Platform.cs +++ b/src/OmniSharp.Shared/Utilities/Platform.cs @@ -136,7 +136,12 @@ private static void ReadDistroNameAndVersion(out string distroName, out Version version = null; // Details: https://www.freedesktop.org/software/systemd/man/os-release.html - const string OS_Release_Path = "/etc/os-release"; + string OS_Release_Path = "/etc/os-release"; + + if (!File.Exists(OS_Release_Path)) + { + OS_Release_Path = "/usr/lib/os-release"; + } if (!File.Exists(OS_Release_Path)) {