mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-31 17:43:04 -06:00
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/aa3944a4-e542-4770-8d17-2acb2c958ce9
31 lines
1,023 B
C#
31 lines
1,023 B
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 not
|
|
{ } v
|
|
|| !(v == "0" || v.Equals("false", StringComparison.OrdinalIgnoreCase)),
|
|
};
|
|
}
|