From d74a3fb5507acfed72969a8c090a3f93ba2a80fa Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 18 Feb 2024 19:00:42 +0800 Subject: [PATCH] fix: wrong path to find Terminal.app; GitInstallDir ends to the folder that contains bin/git; way to open and select file in Finder --- src/BuildMacOS.command | 3 +++ src/Native/MacOS.cs | 4 ++-- src/Views/Histories.axaml | 2 +- src/Views/Preference.axaml.cs | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 src/BuildMacOS.command diff --git a/src/BuildMacOS.command b/src/BuildMacOS.command new file mode 100644 index 00000000..703d0213 --- /dev/null +++ b/src/BuildMacOS.command @@ -0,0 +1,3 @@ +#!/bin/sh + +dotnet publish -c Release -r osx-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained \ No newline at end of file diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 0dc73802..8dd89db8 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -6,7 +6,7 @@ namespace SourceGit.Native { [SupportedOSPlatform("macOS")] internal class MacOS : OS.IBackend { public string FindGitInstallDir() { - if (File.Exists("/usr/bin/git")) return "/usr/bin/git"; + if (File.Exists("/usr/bin/git")) return "/usr"; return string.Empty; } @@ -26,7 +26,7 @@ namespace SourceGit.Native { if (Directory.Exists(path)) { Process.Start("open", path); } else if (File.Exists(path)) { - Process.Start("open", $"\"{path}\" -a Finder"); + Process.Start("open", $"\"{path}\" -R"); } } diff --git a/src/Views/Histories.axaml b/src/Views/Histories.axaml index 6212b1ed..fa88baaf 100644 --- a/src/Views/Histories.axaml +++ b/src/Views/Histories.axaml @@ -16,7 +16,7 @@ Background="{DynamicResource Brush.Contents}" ItemsSource="{Binding Commits}" SelectionMode="Extended" - SelectedItem="{Binding AutoSelectedCommit}" + SelectedItem="{Binding AutoSelectedCommit, Mode=OneWay}" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False" diff --git a/src/Views/Preference.axaml.cs b/src/Views/Preference.axaml.cs index c2f3d43c..b68649fc 100644 --- a/src/Views/Preference.axaml.cs +++ b/src/Views/Preference.axaml.cs @@ -74,7 +74,7 @@ namespace SourceGit.Views { if (DefaultUser != oldUser) cmd.Set("user.name", DefaultUser); if (DefaultEmail != oldEmail) cmd.Set("user.email", DefaultEmail); if (GPGUserKey != oldGPGSignKey) cmd.Set("user.signingkey", GPGUserKey); - if (CRLFMode.Value != oldCRLF) cmd.Set("core.autocrlf", CRLFMode.Value); + if (CRLFMode != null && CRLFMode.Value != oldCRLF) cmd.Set("core.autocrlf", CRLFMode.Value); if (EnableGPGSigning != (oldGPGSignEnable == "true")) cmd.Set("commit.gpgsign", EnableGPGSigning ? "true" : "false"); if (GPGExecutableFile != oldGPGExec) cmd.Set("gpg.program", GPGExecutableFile);