From 370b9bd31e0ece80ac9dfb99564984fb81d48158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enner=20Pe=CC=81rez?= Date: Thu, 28 Mar 2024 01:58:55 -0500 Subject: [PATCH] MacOS Update --- src/SourceGit/Native/MacOS.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/SourceGit/Native/MacOS.cs b/src/SourceGit/Native/MacOS.cs index d0586a12..006f7e8e 100644 --- a/src/SourceGit/Native/MacOS.cs +++ b/src/SourceGit/Native/MacOS.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.IO; using System.Runtime.Versioning; using System.Text; @@ -27,21 +28,17 @@ namespace SourceGit.Native public string FindVSCode() { - if (File.Exists("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code")) - { - return "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"; - } - + var toolPath = "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"; + if (File.Exists(toolPath)) + return toolPath; return string.Empty; } public string FindFleet() { - if (File.Exists("/Applications/Fleet.app/Contents/MacOS/Fleet")) - { - return "/Applications/Fleet.app/Contents/MacOS/Fleet"; - } - + var toolPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet"; + if (File.Exists(toolPath)) + return toolPath; return string.Empty; }