mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-29 01:45:28 +00:00
* Add DISCORDCHATEXPORTER_DISABLE_UPDATE env var to disable auto-update in GUI Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/158dba86-9958-4f57-ab22-174e0606b42f * Rename IsAutoUpdateDisabled to IsAutoUpdateAllowed and env var to DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/aa3944a4-e542-4770-8d17-2acb2c958ce9 * Refine IsAutoUpdateAllowed: group in (), invert, rename v to env, only accept false Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/1467eee2-3069-4f0b-abdf-b1dc65e00a9a * 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 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
32 lines
1.0 KiB
C#
32 lines
1.0 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)
|
|
),
|
|
};
|
|
}
|