Comments (4)
shdotenv
is not designed to be a merge tool. However, env -i
seems to be a good workaround.
In some environments, you may need to pass the PATH
and some environment variables (e.g. SHDOTENV_AWK
).
env -i PATH="$PATH" shdotenv --noexport --env .env.prod --env .env
Considering that all environment variables disappear, I think the addition of the -i
(--ignore-environment
) option is an acceptable feature.
from shdotenv.
For what purpose would you use this?
$ KEY1='blaaat' ./shdotenv --noexport --env test.env KEY2='value2'
I don't want that. I want the result always to have both keys.
Which is the result you expect?
KEY1='value1'
KEY2='value2'
or
KEY1='blaaat'
KEY2='value2'
from shdotenv.
I expect this:
$ KEY1='blaaat' ./shdotenv --noexport --env test.env
KEY1='value1'
KEY2='value2'
So the command does not use existing env vars.
Right now, I have fixed it like this:
env -i shdotenv --noexport --env .env.prod --env .env
And that works fine as well.
My use case is that I want to use shdotenv
to combine multiple .env
files and let them overload into 1 consolidated file. That file is then put inside Kubernetes configuration. So reading from my current bash / env doesn't make sense, as the consolidated file will be executed on a different system anyway.
from shdotenv.
Done
from shdotenv.
Related Issues (12)
- I will remove some of the (short) options in v0.10.0
- Output without quotes HOT 5
- Wrong choice when multiple values in file HOT 4
- Expand $HOME directory shorthand ~ (tilde character) to absolute path
- Binary env variables?
- Make ~/.local/bin as the default download target in README
- shdotenv seems to ignore -e /dev/null
- Special character in unqouted variable HOT 4
- .shdotenv for specify dialect HOT 1
- Rename the -s (-shell) option to the -f (--format) option
- generate dotenv compatible file based on current env HOT 11
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 shdotenv.