DiscordChatExporter/DiscordChatExporter.Gui/StartOptions.cs
copilot-swe-agent[bot] a1f16df950 Fix CSharpier formatting: move is { } env to indented new line
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/7933cfe4-ecad-4697-8b9c-ee3991aa147e
2026-03-21 18:21:35 +00:00

32 lines
1 KiB
C#

using System;
using System.IO;
namespace DiscordChatExporter.Gui;
public partial class StartOptions
{
public required string SettingsPath { get; init; }
public required bool IsAutoUpdateAllowed { get; init; }
}
public partial class StartOptions
{
public static StartOptions Current { get; } =
new()
{
SettingsPath =
Environment.GetEnvironmentVariable("DISCORDCHATEXPORTER_SETTINGS_PATH") is { } path
&& !string.IsNullOrWhiteSpace(path)
? Path.EndsInDirectorySeparator(path) || Directory.Exists(path)
? Path.Combine(path, "Settings.dat")
: path
: Path.Combine(AppContext.BaseDirectory, "Settings.dat"),
IsAutoUpdateAllowed = !(
Environment.GetEnvironmentVariable("DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE")
is { } env
&& env.Equals("false", StringComparison.OrdinalIgnoreCase)
),
};
}