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

[Scripts] Pass original working directory as env variable #3179

Closed
Bubichoo-Teitichoo opened this issue Sep 23, 2024 · 1 comment
Closed
Labels
⭐ enhancement Improvements for existing features 💝 good first issue Good for newcomers

Comments

@Bubichoo-Teitichoo
Copy link

Is your feature/enhancement proposal related to a problem? Please describe.

Coming from Poetry + Poe I'm missing the ability read/use the working directory of the calling shell within my scripts.
Especially with mono-repos I may need the actual working directory of the shell to properly do some scripted actions in a particular part of the repo.

Describe the solution you'd like

The solution to the problem would be rather simple. Somewhere in TaskRunner._run_process you would just have to create a environment variable that holds the current working directory. e.g.

os.environ["PDM_PWD"] = str(Path.cwd())

For naming I'd propose something similar to what Poe is doing: https://poethepoet.natn.io/env_vars.html

I'm happy to make the relevant changes and create a PR if you think this proposal is good.

@Bubichoo-Teitichoo Bubichoo-Teitichoo added the ⭐ enhancement Improvements for existing features label Sep 23, 2024
@frostming
Copy link
Collaborator

I'd suggest PDM_RUN_CWD but PR welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features 💝 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants