Skip to content

fix regression in displaying export errors #1469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

jeremyschlatter
Copy link
Contributor

@jeremyschlatter jeremyschlatter commented Jul 15, 2025

Fixes a regression introduced by cf9222e.

At this point in the control flow, err is non-nil if there was an error in config.EnvFromRC. We depend on it remaining non-nil until the return statement. cf9222e inadvertently unconditionally overwrote err, causing this function to never report errors from config.EnvFromRC. Fixed by giving the new error a different name.

You can test the issue by editing this repo's .envrc file and then running go run . export bash.

Fixes #1463

Fixes a regression introduced by:

  cf9222e refactor: better error handling for Dump and Error

At this point in the control flow, `err` is non-nil if there was an
error in config.EnvFromRC. We depend on it remaining non-nil until the
return statement. cf9222e inadvertently unconditionally overwrote `err`,
causing this function to never report errors from config.EnvFromRC.
Fixed by giving the new error a different name.

You can test the issue by editing this repo's .envrc file and then
running `go run . export bash`.

Fixes direnv#1463
@zimbatm
Copy link
Member

zimbatm commented Jul 20, 2025

thanks!

Merged via the queue into direnv:master with commit 4b6a7b7 Jul 20, 2025
19 checks passed
@jeremyschlatter jeremyschlatter deleted the issue-1463 branch July 21, 2025 00:02
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.

Direnv 2.37.0 hides blocked .envrc warning
2 participants