mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-13 22:08:37 +00:00
22 lines
607 B
C#
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;
|
|
}
|
|
}
|
|
}
|