Skip to content

Don't load .env files by default#911

Merged
zimbatm merged 1 commit intodirenv:masterfrom
zimbatm:load-dotenv
Mar 26, 2022
Merged

Don't load .env files by default#911
zimbatm merged 1 commit intodirenv:masterfrom
zimbatm:load-dotenv

Conversation

@zimbatm
Copy link
Copy Markdown
Member

@zimbatm zimbatm commented Mar 26, 2022

Loading the .env files is a change in behaviour and broke
backward-compatibility. It sounds really nice at first but it turns out
that many users have .env files littered in their repository and cause a
direnv reload. It's possible to turn that feature off but now they have
one extra step to instruct their users.

This commit inverts the behaviour and turns that feature off by default
to restore back-compat.

Before:

[global]
skip_dotenv = true

Now (with a different key name):

[global]
load_dotenv = false # which is the default

See also #878.

Loading the `.env` files is a change in behaviour and broke
backward-compatibility. It sounds really nice at first but it turns out
that many users have .env files littered in their repository and cause a
direnv reload. It's possible to turn that feature off but now they have
one extra step to instruct their users.

This commit inverts the behaviour and turns that feature off by default
to restore back-compat.

See also direnv#878.
@zimbatm zimbatm merged commit 71f904a into direnv:master Mar 26, 2022
@zimbatm zimbatm deleted the load-dotenv branch March 26, 2022 14:19
@henrik242
Copy link
Copy Markdown

Great!

@glensc
Copy link
Copy Markdown
Contributor

glensc commented Mar 28, 2022

please also highlight in the PR body that the config key changed, it's not that visible. as both words are of the same length and the common part exceeds the differing part. so typical eye will optimize the words to be the same.

@vschoener
Copy link
Copy Markdown

vschoener commented Mar 31, 2022

I think the document misses the part where is the toml config, how to create it, and what to configure to use dotenv files back again. (Or I didn't find the info :p)

Edit: Found out there https://direnv.net/man/direnv.toml.1.html

lemald added a commit to mbta/skate that referenced this pull request Apr 13, 2022
A recent release of direnv disabled loading of .env files by
default. See direnv/direnv#911. Loading of
.env files can still be enabled by changing settings, but it's simpler
to provide documentation and an example that just works without
further changes beyond adding your personal settings / secrets.
lemald added a commit to mbta/skate that referenced this pull request Apr 19, 2022
* docs: update to work out-of-the-box with current direnv version

A recent release of direnv disabled loading of .env files by
default. See direnv/direnv#911. Loading of
.env files can still be enabled by changing settings, but it's simpler
to provide documentation and an example that just works without
further changes beyond adding your personal settings / secrets.

* docs: additional README updates
doctaphred added a commit to doctaphred/direnv that referenced this pull request May 4, 2022
Follow-up on direnv#845 and direnv#911: resolves direnv#916

This commit simply updates the error messages and documentation to more
accurately reflect the current opt-in configurable handling of `.env` files.
zimbatm pushed a commit that referenced this pull request May 11, 2022
Follow-up on #845 and #911: resolves #916

This commit simply updates the error messages and documentation to more
accurately reflect the current opt-in configurable handling of `.env` files.
ivanbrennan added a commit to ivanbrennan/nixdots that referenced this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants