desktop
desktop copied to clipboard
/usr/local/bin not in PATH for git hooks
The problem
I have a pre-commit git hook with a Docker command like:
docker compose exec -T -u ...
When trying to commit files in GitHub Desktop I get an error from the hook "docker: command not found". Committing files from the command line works fine. On further investigation, it looks like /usr/local/bin
is missing from my PATH
when git hooks run from GitHub Desktop. Any ideas how to resolve this?
Release version
2.9.12 (arm64)
Operating system
macOS
Steps to reproduce the behavior
No response
Log files
No response
Screenshots
No response
Additional context
No response
https://github.community/t/github-desktop-seems-to-be-using-the-wrong-path-variable/251248/4
This workaround worked for me
@gilbitron Did you have any luck resolving this?
@younkim I just brute-forced it:
PATH=/usr/local/bin:$PATH && docker compose exec -T -u ...
Bump on this to get fixed on Github's end. It would be much more ideal to automate adding the env variable to PATH upon installation of GH Desktop if that's possible :)