discord-bot/CompatBot/Utils/SandboxDetector.cs
2019-10-31 16:00:27 +05:00

22 lines
607 B
C#

using System;
namespace CompatBot.Utils
{
public static class SandboxDetector
{
public static SandboxType Detect()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SNAP")))
return SandboxType.Snap;
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("FLATPAK_SYSTEM_DIR")))
return SandboxType.Flatpak;
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("RUNNING_IN_DOCKER")))
return SandboxType.Docker;
return SandboxType.None;
}
}
}