pivoshenko / poetry-plugin-dotenv

poetry-plugin-dotenv - is the plugin that automatically loads environment variables from a dotenv file into the environment before poetry commands are run
MIT License
74 stars 4 forks source link

Add support of the `poetry --directory` #260

Closed pivoshenko closed 3 months ago

pivoshenko commented 4 months ago

Discussed in https://github.com/pivoshenko/poetry-plugin-dotenv/discussions/259

Originally posted by **brainwo** May 31, 2024 How to use this plugin with `poetry --directory`? I have to run a project in some directory with `--directory` flag. But it doesn't seem to read the `.env` file relative to the project directory. I setup the plugin like this: ```toml [tool.poetry.plugins.dotenv] ignore = "false" location = ".env" ``` This works: ```sh # Inside /path/to/directory poetry run python3 projectname ``` This doesn't read the `.env` file: ```sh poetry --directory /path/to/directory run python3 /path/to/directory/projectname ```

Special thanks to @brainwo for his input 🐱

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed.