adamws / kicad-git

Git actions directly from KiCad's PCB editor window
GNU General Public License v3.0
20 stars 1 forks source link

Add logic to select correct `git` on macOS #2

Closed Gasman2014 closed 7 months ago

Gasman2014 commented 7 months ago

Subprocess on macOS uses the system path and not the user CLI environment path. So, Apple's own Git version at /usr/bin will be preferred to a user installed version unless the path is made explicit. Most people use a CLI package manager such as 'Homebrew' to install and manage their own binary versions - eg git citool To access any user installed binaries, the full path must be enumerated i.e /opt/homebrew/bin/git

This solution works for me using Homebrew installed binaries, MacPorts installs elsewhere and I have not extended this. Note, there is no error checking here for path validity.