fix: support XL_PLATFORM as well (hopefully)

This commit is contained in:
Kaz Wolfe 2025-03-24 09:12:13 -07:00
parent fdbfdbb2cd
commit 30cadef34b
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,18 @@
using System.Diagnostics.CodeAnalysis;
namespace Dalamud.Common.Util;
public static class EnvironmentUtils
{
/// <summary>
/// Attempts to get an environment variable using the Try pattern.
/// </summary>
/// <param name="variableName">The env var to get.</param>
/// <param name="value">An output containing the env var, if present.</param>
/// <returns>A boolean indicating whether the var was present.</returns>
public static bool TryGetEnvironmentVariable(string variableName, [NotNullWhen(true)] out string? value)
{
value = Environment.GetEnvironmentVariable(variableName);
return value != null;
}
}