Comments (5)
That's interesting. You raise a valid point, but I'm not sure how to easily make both work together. The problem is dotenv
doesn't support "cascade" natively. There's probably no way to avoid edge cases without dotenv
supporting cascade natively.
from dotenv-cli.
What if we reversed the paths
array if override
is set before iterating through it? I'm trying to think if that will cause any negative side effects.
from dotenv-cli.
Yeah, there was an earlier discussion: #63 (comment)
I think it's just incompatible. Feel free to make a PR to update the README to document this but this is not really solvable.
I think the best solution is just erroring out if using override
together with multiple files, ...
from dotenv-cli.
Ooh man, this one bit me in the butt the other day.
Like @llovett2 found, when you run override with cascade, the order of files is effectively inverted such that values in .env
will override .env.test
.
We need to do something about this, because of the potential impact. In my case, a dev on my team ran unit tests that blew away our QA database.
I'm available to submit a new pull-request, but @entropitor, I'm looking to discover what you're likely to accept, considering this issue was closed before.
- Invert the files array when
argv.c && argv.o
.- I actually believe this is a pretty simple and readable change.
I have it ready to go locally.#92
- I actually believe this is a pretty simple and readable change.
- Prevent "cascade with override".
- Literally throw a runtime error if
argv.c && argv.o
saying it's not supported.
- Literally throw a runtime error if
from dotenv-cli.
I think it's best to throw. I knew this was a problem when merging that's why I pushed back so hard on cascade. The other solution has a problem with expanding variables so I don't think that's valid either. I guess throwing is the most elegant solution! Happy to merge such a pr
from dotenv-cli.
Related Issues (20)
- Documentation should recommend use of "--" separator HOT 2
- Specify directory containing .env files HOT 3
- its adding double quotes HOT 1
- [Bug]Runtime error when using "-p" option HOT 3
- [Documentation] Clarify if the files specified by `-e` are read in addition to, or instead of the default ones HOT 1
- [feature] Ability to specify the exact sequence of .env files to process using absolute paths HOT 1
- COPYRIGHT is missing HOT 1
- sorry HOT 1
- dotenv-expand: TypeError: Cannot read property 'split' of undefined HOT 6
- .env.local should have higher priority than .env.<environment> HOT 2
- unable to run command with prefix HOT 1
- Fail to load env HOT 4
- Allow setting variable with a value containing strings HOT 7
- Change load order of multiple .env files HOT 2
- Override system variables HOT 2
- Loading Vault files HOT 4
- Dotenv-cli removes output colors HOT 1
- npm ERR! could not determine executable to run HOT 1
- Add longopts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotenv-cli.