-
Notifications
You must be signed in to change notification settings - Fork 35
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
.env subfolders #8
Comments
I think it's possible to implement this feature to work using the path template. It would look like: require('dotenv-flow').config({
path: './.env/${NODE_ENV}/.env.${NODE_ENV}?(.local)'
}); The same approach applies to #7. For that example, it would look like: require('dotenv-flow').config({
path: './?(local.)${NODE_ENV}.env'
}); As you can understand this is not supported by the module at the time, so your PR's are very welcome! |
Can i send PR on this issue i'm currently understanding the codebase after that i will send PR . |
Hello gentlemen, With the new require('dotenv-flow').config({
pattern: '.env/[node_env/].env[.node_env][.local]'
}); This feature is going to be released with dotenv-flow |
…s' naming convention, closes #8 This PR introduces a new configuration option `pattern`. It allows users to define a custom naming convention for `.env*` files that dotenv-flow will read. The default value for the `pattern` option is `".env[.node_env][.local]"` which is fully backward-compatible with the current dotenv-flow's naming convention. BREAKING CHANGE: `.listFiles()` (exposed internal API method) doesn't receive argument `dirname` anymore and returns a list of filenames without the full path (just a name of the file).
…s' naming convention, closes #8 This PR introduces a new configuration option `pattern`. It allows users to define a custom naming convention for `.env*` files that dotenv-flow will read. The default value for the `pattern` option is `".env[.node_env][.local]"` which is fully backward-compatible with the current dotenv-flow's naming convention. BREAKING CHANGE: `.listFiles()` (exposed internal API method) doesn't receive argument `dirname` anymore and returns a list of filenames without the full path (just a name of the file).
In my project's root, I have a
.env
folder where I store my.env.<environment>
and.env.<environment>.local
files. This works great when I pass the{ cwd: '.env/' }
option toconfig
, but I'd like to have subfolders under.env
that would hold each pair of environment files.For example:
Changing the
cwd
option to.env/*
or.env/**/*
doesn't seem to work and my project fails to recognize variables not in.env
or.env.local
. Any ideas?The text was updated successfully, but these errors were encountered: