Fixes #832, add debian package and coreclr prereq check to the build.
PR Feedback
This commit is contained in:
parent
ea4f15bb5a
commit
adc6aa7eff
4 changed files with 216 additions and 34 deletions
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
|
||||
public static class CurrentPlatform
|
||||
{
|
||||
public static bool IsWindows
|
||||
{
|
||||
get
|
||||
{
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsOSX
|
||||
{
|
||||
get
|
||||
{
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsLinux
|
||||
{
|
||||
get
|
||||
{
|
||||
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsUbuntu
|
||||
{
|
||||
get
|
||||
{
|
||||
var osname = PlatformServices.Default.Runtime.OperatingSystem;
|
||||
return string.Equals(osname, "ubuntu", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsCentOS
|
||||
{
|
||||
get
|
||||
{
|
||||
var osname = PlatformServices.Default.Runtime.OperatingSystem;
|
||||
return string.Equals(osname, "centos", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue