path seems not to be inherited when spawning git
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 325
- PR merge metrics
- No merged PRs in 30d
Description
Hi, first up, thanks for this awesome idea -- I only found patch-package a couple of days ago and I'm already in love! Simple but so useful. I'm looking forward to removing lots of forked dependencies from my repo in coming days!
I'm on a Mac, and when I first asked patch-package to create a patch, I got a strange error:
> `xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.`
This is the output from /usr/bin/git, which is a small stub on Macs that asks the user to install Xcode. I already have the full git suite installed, and on my $PATH at /usr/local/bin/git, and I use VS Code, so I don't want to install Xcode too.
I found that if I change this line in makePatch.js
> `env: { HOME: tmpRepo.name },`
to
> `env: { ...process.env, HOME: tmpRepo.name },`
patch-package started running the correct version of git, and was able to create a patch.
I think the unchanged line might discard all existing environment variables in the spawned process, including $PATH. But I don't know how to be sure, because I can't spawn 'set' (it's a built-in) and if I spawn a sub-shell like 'bash -c set', it picks up the correct path from .bashrc.
Needless to say, after getting this working, I used patch-package to patch itself :-D
If you think this is not a bug please feel free to ignore me, it may just be something is weird or broken on my system! Thanks again
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.