code_review: PR #453

* remove Visual Studio ENC0004 warning
This commit is contained in:
leo 2024-09-10 09:22:35 +08:00
parent 28f83e12fd
commit bede3663ec
No known key found for this signature in database

View file

@ -53,7 +53,11 @@ namespace SourceGit.Native
{ {
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var dir = string.IsNullOrEmpty(workdir) ? home : workdir; var dir = string.IsNullOrEmpty(workdir) ? home : workdir;
var terminal = DetectTerminal();
var terminal = "Terminal";
if (Directory.Exists("/Applications/iTerm.app"))
terminal = "iTerm";
Process.Start("open", $"-a {terminal} \"{dir}\""); Process.Start("open", $"-a {terminal} \"{dir}\"");
} }
@ -61,13 +65,5 @@ namespace SourceGit.Native
{ {
Process.Start("open", $"\"{file}\""); Process.Start("open", $"\"{file}\"");
} }
private static string DetectTerminal()
{
if (Directory.Exists("/Applications/iTerm.app"))
return "iTerm";
return "Terminal";
}
} }
} }