using System.Runtime.InteropServices;

namespace Lentia.Core.Utils;

public static class OsHelper {
    public static string GetPlatformString() {
        string os = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "windows" : RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "mac-os" : "linux";
        string arch = RuntimeInformation.OSArchitecture == Architecture.X64 ? "x64" : "x86";
        return $"{os}-{arch}";
    }

    public static string GetOSName() {
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return "windows";
        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) return "osx";
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return "linux";
        return "unknown";
    }
}