mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix: application data dir may not have been created before crash (#161)
This commit is contained in:
parent
f1f54bf6fe
commit
49ce07443e
4 changed files with 8 additions and 12 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Avalonia;
|
||||
|
||||
|
@ -20,6 +21,7 @@ namespace SourceGit.Native
|
|||
void OpenWithDefaultEditor(string file);
|
||||
}
|
||||
|
||||
public static readonly string DataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SourceGit");
|
||||
public static string GitExecutable { get; set; } = string.Empty;
|
||||
public static List<Models.ExternalTool> ExternalTools { get; set; } = new List<Models.ExternalTool>();
|
||||
|
||||
|
@ -72,6 +74,9 @@ namespace SourceGit.Native
|
|||
|
||||
public static void SetupApp(AppBuilder builder)
|
||||
{
|
||||
if (!Directory.Exists(DataDir))
|
||||
Directory.CreateDirectory(DataDir);
|
||||
|
||||
_backend.SetupApp(builder);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue