desktop icon indicating copy to clipboard operation
desktop copied to clipboard

/usr/local/bin not in PATH for git hooks

Open gilbitron opened this issue 2 years ago • 4 comments

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

gilbitron avatar Apr 11 '22 10:04 gilbitron

https://github.community/t/github-desktop-seems-to-be-using-the-wrong-path-variable/251248/4

This workaround worked for me

dong-brian avatar Jul 08 '22 14:07 dong-brian

@gilbitron Did you have any luck resolving this?

younkim avatar Sep 14 '22 16:09 younkim

@younkim I just brute-forced it:

PATH=/usr/local/bin:$PATH && docker compose exec -T -u ...

gilbitron avatar Sep 14 '22 16:09 gilbitron

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 :)

sumitramanga avatar May 24 '23 23:05 sumitramanga