fix<Native>: fix wrong file filter on macOS platform.

This commit is contained in:
leo 2024-02-21 11:29:28 +08:00
parent dbd91c9b58
commit 353557ec10
10 changed files with 41 additions and 45 deletions

View file

@ -5,7 +5,7 @@ using System.IO;
namespace SourceGit.Native {
public static class OS {
public interface IBackend {
string FindGitInstallDir();
string FindGitExecutable();
string FindVSCode();
void OpenTerminal(string workdir);
@ -14,15 +14,11 @@ namespace SourceGit.Native {
void OpenWithDefaultEditor(string file);
}
public static string GitInstallDir {
public static string GitInstallPath {
get;
set;
}
public static string GitExecutableFile {
get => Path.Combine(GitInstallDir, "bin", OperatingSystem.IsWindows() ? "git.exe" : "git");
}
public static string VSCodeExecutableFile {
get;
set;
@ -40,8 +36,8 @@ namespace SourceGit.Native {
}
}
public static string FindGitInstallDir() {
return _backend?.FindGitInstallDir();
public static string FindGitExecutable() {
return _backend?.FindGitExecutable();
}
public static void OpenInFileManager(string path, bool select = false) {