2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 00:23:41 -04:00

more reliable fallback for default directory

This commit is contained in:
Xjph
2021-10-26 19:36:57 -02:30
parent a2700d6dc0
commit c0cc115545

View File

@ -213,16 +213,21 @@ namespace Observatory
{
//throw new DirectoryNotFoundException($"Directory '{path}' does not exist.");
//Don't throw, not handling that right now. Just set to current folder.
logDirectory = new DirectoryInfo(".");
logDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
logDirectory = new DirectoryInfo(GetSavedGamesPath() + @"\Frontier Developments\Elite Dangerous");
string defaultJournalPath = GetSavedGamesPath() + @"\Frontier Developments\Elite Dangerous";
logDirectory =
Directory.Exists(defaultJournalPath)
? new DirectoryInfo(defaultJournalPath)
: new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
logDirectory = new DirectoryInfo(".");
logDirectory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
}
else
{