New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose an env variable that indicates if pre-commit is running #1426
Comments
I'd be curious to hear the concrete usecase, it seems a bit odd to need to know this information |
The use case is hacky so I don't post this on GitHub to maintain good reputation 😄 (#todayInOpensource). Well, the thing is that R has a startup process that runs something like a Other approach is to always exclude this I understand if you don't want to support this hack 😊. It's also only a minor problem. |
lol, I know that feel ;) it should be easy to add something that sets |
In some circumstances, it could be helpful to know inside an executable / function / script if it was invoked from pre-commit or from some other process. I wrote a hook that just printed all env variables set but I could not find an env variable like
PRECOMMIT_RUNNING
or similar. Would you consider setting such an env variable during running pre-commit? I searched old issues and documentation but I could not find anything.The text was updated successfully, but these errors were encountered: