Skip to content
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

Use node process environment variables as base for overridden git process environment #1017

Open
steveukx opened this issue Sep 1, 2024 · 0 comments

Comments

@steveukx
Copy link
Owner

steveukx commented Sep 1, 2024

Currently when simpleGit is configured with an override for a single environment variable:

const git = simpleGit().env('A', 'aaa');

The git child process will be called with an environment of only that override, whereas the default would be to use the process.environment from the containing node process.

This might be intentional, especially in the case of using an object form:

const git = simpleGit().env({ ...process.env, 'A': 'aaa' });

But to allow for more flexibility and cleaner calling code, there should be a constructor plugin to allow opting in / out of this behaviour, eg:

const git = simpleGit({ env: { inherit: true } }).env('A', 'aaa');

Would cause the git child process to be called with the current state of the process.env object as a base, overridden with the explicitly configured {A: 'aaa'}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant