Giter Club home page Giter Club logo

Comments (4)

ko1nksm avatar ko1nksm commented on May 27, 2024 1

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.

ko1nksm avatar ko1nksm commented on May 27, 2024

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.

ruudk avatar ruudk commented on May 27, 2024

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.

ko1nksm avatar ko1nksm commented on May 27, 2024

Done

from shdotenv.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.