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

provide an environment variable with the temp directory name #146

Open
jeff350 opened this issue Feb 13, 2024 · 3 comments · May be fixed by #147
Open

provide an environment variable with the temp directory name #146

jeff350 opened this issue Feb 13, 2024 · 3 comments · May be fixed by #147
Labels
enhancement New feature or request

Comments

@jeff350
Copy link

jeff350 commented Feb 13, 2024

Describe the solution you'd like
add a XARGS_REPO_DIRECTORY variable to access the path of the temporary directory

Describe alternatives you've considered
I can't find an easy way to access the path

Additional context
I came across this issue while trying to use git-xargs to appy copier templates across a large number of repos. The issue is that copier requires both the template and target directory to be specified. Here copier's target directory needs to be git-args temp directory

@jeff350 jeff350 added the enhancement New feature or request label Feb 13, 2024
@jeff350 jeff350 linked a pull request Feb 13, 2024 that will close this issue
4 tasks
@osterman
Copy link

osterman commented Mar 2, 2024

Technically, this is already supported.

As you can see here it's just calling ioutil.TempDir which properly handles temp dir environment variables. (In my experience, most syscalls to get temporary directories respect some kind of env)

I was able to export TMPDIR on macOS and clone all repos to that directory, provided I created it first. This variable my differ based on OS.

@jeff350
Copy link
Author

jeff350 commented Mar 2, 2024

@osterman Thank you for looking at the issue but this is not what I am trying to solve.

I am looking to expose the full path of the directory in /tmp that contains the repo currently being targeted as an environment variable that can be used inside the script that is ran by git-xargs.

I have opened #147 to implemented this feature and I am using it to meet my needs. it is just waiting on a review to get merged in.

@osterman
Copy link

osterman commented Mar 8, 2024

Aha, my fault - I didn't catch that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants