code_style: using avalonia's editorconfig and run dotnet format.

This commit is contained in:
leo 2024-03-31 16:54:29 +08:00
parent 3c38f681bd
commit d89a00e559
233 changed files with 1806 additions and 1254 deletions

View file

@ -25,21 +25,24 @@ namespace SourceGit.Native
public string FindGitExecutable()
{
if (File.Exists("/usr/bin/git")) return "/usr/bin/git";
if (File.Exists("/usr/bin/git"))
return "/usr/bin/git";
return string.Empty;
}
public string FindVSCode()
{
var toolPath = "/usr/share/code/code";
if (File.Exists(toolPath)) return toolPath;
if (File.Exists(toolPath))
return toolPath;
return string.Empty;
}
public string FindFleet()
{
var toolPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/.local/share/JetBrains/Toolbox/apps/fleet/bin/Fleet";
if (File.Exists(toolPath)) return toolPath;
if (File.Exists(toolPath))
return toolPath;
return string.Empty;
}
@ -117,4 +120,4 @@ namespace SourceGit.Native
proc.Close();
}
}
}
}

View file

@ -22,7 +22,8 @@ namespace SourceGit.Native
public string FindGitExecutable()
{
if (File.Exists("/usr/bin/git")) return "/usr/bin/git";
if (File.Exists("/usr/bin/git"))
return "/usr/bin/git";
return string.Empty;
}
@ -82,4 +83,4 @@ namespace SourceGit.Native
Process.Start("open", file);
}
}
}
}

View file

@ -116,4 +116,4 @@ namespace SourceGit.Native
private static readonly IBackend _backend;
}
}
}

View file

@ -105,7 +105,8 @@ namespace SourceGit.Native
}
var exePath = builder.ToString();
if (string.IsNullOrEmpty(exePath)) return null;
if (string.IsNullOrEmpty(exePath))
return null;
return exePath;
}
@ -123,14 +124,16 @@ namespace SourceGit.Native
}
var toolPath = Environment.ExpandEnvironmentVariables($"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe");
if (File.Exists(toolPath)) return toolPath;
if (File.Exists(toolPath))
return toolPath;
return string.Empty;
}
public string FindFleet()
{
var toolPath = Environment.ExpandEnvironmentVariables($"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\AppData\\Local\\Programs\\Fleet\\Fleet.exe");
if (File.Exists(toolPath)) return toolPath;
if (File.Exists(toolPath))
return toolPath;
return string.Empty;
}
@ -153,7 +156,8 @@ namespace SourceGit.Native
var startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.FileName = bash;
if (!string.IsNullOrEmpty(workdir) && Path.Exists(workdir)) startInfo.WorkingDirectory = workdir;
if (!string.IsNullOrEmpty(workdir) && Path.Exists(workdir))
startInfo.WorkingDirectory = workdir;
Process.Start(startInfo);
}
@ -211,4 +215,4 @@ namespace SourceGit.Native
}
}
}
}
}