refactor: rewrite the way to support HomeBrew pathes on macOS (#507)
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions

This commit is contained in:
leo 2024-09-25 10:35:07 +08:00
parent a52ebffbf3
commit a8685f2047
No known key found for this signature in database
2 changed files with 4 additions and 5 deletions

View file

@ -12,11 +12,6 @@
<string>SOURCE_GIT_VERSION.0</string> <string>SOURCE_GIT_VERSION.0</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>11.0</string> <string>11.0</string>
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>SourceGit</string> <string>SourceGit</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>

View file

@ -68,6 +68,10 @@ namespace SourceGit.Commands
if (OperatingSystem.IsLinux()) if (OperatingSystem.IsLinux())
start.Environment.Add("LANG", "en_US.UTF-8"); start.Environment.Add("LANG", "en_US.UTF-8");
// Fix sometimes `LSEnvironment` not working on macOS
if (OperatingSystem.IsMacOS())
start.Environment.Add("PATH", "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin");
// Force using this app as git editor. // Force using this app as git editor.
switch (Editor) switch (Editor)
{ {