Skip to content
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

fix: properly pass missing env vars in Plugin.Update #1899

Closed
wants to merge 1 commit into from

Conversation

n-rodriguez
Copy link
Contributor

Summary

Properly pass missing env vars in Plugin.Update

Fixes:

Thank you!

@n-rodriguez n-rodriguez requested a review from a team as a code owner February 6, 2025 02:31
missingcharacter added a commit to missingcharacter/asdf-direnv that referenced this pull request Feb 7, 2025
@@ -255,6 +255,9 @@ func (p Plugin) Update(conf config.Config, ref string, out, errout io.Writer) (s
}

env := map[string]string{
"HOME": os.Getenv("HOME"),
"ASDF_DIR": os.Getenv("ASDF_DIR"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASDF_DIR isn't something that is used in asdf 0.16.0+. Are there still plugins relying on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we shouldn't propagate all env variables of the current process by default here (similar to #1958 )?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @Stratus3D thank you!

Copy link
Member

@Stratus3D Stratus3D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if plugin callbacks need arbitrary environment variables I think we should pass-through any environment variable that is already set. Like we do for shims when executing the real executable.

@n-rodriguez
Copy link
Contributor Author

Closed in favor of #1982

@n-rodriguez n-rodriguez deleted the fix/missing_env_vars branch February 24, 2025 18:30
@Stratus3D
Copy link
Member

Replaced by #1982

@n-rodriguez
Copy link
Contributor Author

@Stratus3D Closed in favor of #1982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants