feat/files-control #52

Open
notazof wants to merge 32 commits from feat/files-control into main
Showing only changes of commit 1af839e14e - Show all commits

POSTIT_SETTINGS_JSON env var
Some checks failed
Dotnet build and test / build (pull_request) Failing after 10m54s

Paul Schneider 2026-09-13 13:34:39 +01:00
Signed by: notazof
GPG key ID: 1DD5D838E5343B06

View file

@ -15,7 +15,7 @@ namespace PostIt.ViewModels;
public partial class Settings : ViewModelBase
{
const string SettingsFileName = "postit-settings.json";
public string SettingsFileName {get; private set;} = "postit-settings.json";
[ObservableProperty]
public partial AuthenticationSettings Authentication { get; set; } = new();
@ -251,12 +251,18 @@ public partial class Settings : ViewModelBase
return;
}
}
if (Environment.GetEnvironmentVariable("POSTIT_SETTINGS_JSON") is string envJson
&& !string.IsNullOrWhiteSpace(envJson))
{
Console.WriteLine("🔎 Loading settings from POSTIT_SETTINGS_JSON environment variable.");
ApplyJson(envJson, "POSTIT_SETTINGS_JSON");
Loaded = true;
return;
}
string configDir = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"PostIt"
);
Directory.CreateDirectory(configDir);
string configPath = Path.Combine(configDir, SettingsFileName);