Skip to content

Allow loading of values from .env file repo root #391

@jongio

Description

@jongio

Some projects are going to want to put env vars that are shared in all envs and shipped in the repo, even as a placeholder, like this:

SOMEVALUE=

Right now we don't allow this because the user has to first create an env, then open the .env file, then copy and paste the values there.

I would like our code that loads env vars from the current env to also check and load a .env file from the root of the repo, if it exists.

Values in env/.env values would override values in root/.env, so load root/.env first and then env/.env

If we have .env file in root of repo

SOMEVALUE=FOO

And this in the env/.env file

SOMEVALUE=BAR

Then SOMEVALUE would be set to BAR

If we only have, root/.env:

SOMEVALUE=FOO

Then SOMEVALUE would be set to FOO.

Metadata

Metadata

Assignees

Labels

area/core-cliCLI commands, cmd/, internal/cmd/enhancementNew feature or improvement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions