Skip to content

Conversation

@1cg
Copy link

@1cg 1cg commented Feb 8, 2022

This change allows you to configure a recursive search through parent directories for a .env file. This is useful in a multi-module project when you want to share a common .env file across multiple modules.

No worries if this isn't a feature you want, but I needed it for my own project.

This change allows you to configure a recursive search through parent directories for a .env file.  This is useful in a multi-module project when you want to share a common .env file across multiple modules.
@1cg
Copy link
Author

1cg commented Feb 16, 2022

pinging on this, any interest?

@cdimascio cdimascio self-requested a review March 27, 2022 02:08
@Miuler
Copy link

Miuler commented Oct 26, 2023

Please, add suppor for this feature, the recursive search of .env works in other languages such as Rust and others, and is very useful.

@1cg @cdimascio

@agoncal
Copy link

agoncal commented Nov 4, 2025

A shame this is not implemented, because in a Maven multi-module environment, with a single .env file, this would be useful.

Or, if you want to keep the API as it is, why not having the possibility to add several directories? Something like:

Dotenv.configure().directory("../").directory("./").load()

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants