fix: application data dir may not have been created before crash (#161)

This commit is contained in:
leo 2024-06-03 09:44:12 +08:00
parent f1f54bf6fe
commit 49ce07443e
4 changed files with 8 additions and 12 deletions

View file

@ -62,9 +62,7 @@ namespace SourceGit
builder.Append(ex.StackTrace);
var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"SourceGit",
$"crash_{time}.log");
var file = Path.Combine(Native.OS.DataDir, $"crash_{time}.log");
File.WriteAllText(file, builder.ToString());
}
}