-
Notifications
You must be signed in to change notification settings - Fork 263
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
feat: Lazily evaluated env template variables in path entries #2310
Conversation
src/config/env_directive.rs
Outdated
@@ -79,6 +137,8 @@ impl EnvResults { | |||
) -> eyre::Result<Self> { | |||
let settings = Settings::get(); | |||
let mut ctx = BASE_CONTEXT.clone(); | |||
debug!("resolve: input: {:#?}", &input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should all be trace level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix, I just added these while trying to understand the code. If you feel some serve little purpose I am happy to remove them.
Also, if you have suggestions for better identifier names, I will happily change them. 🙏🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed all debug calls to trace, and added a custom deserializer to get both the tests to pass and the lazy path entries to be parsed correctly.
Any feedback, @jdx? |
Implements #1912.
Please note that there's a TODO entry in
mise::EnvMapVisitor.visit_map
. The issue is thatdeserialize_with = "deserialize_arr"
can either be left off or added topath: Vec<PathEntry>
:{ value = "{{ env.GEM_HOME }}/bin" }
) cause a parse error (invalid type: map, expected a string
) but the 3 failing tests now pass.I am hoping you can help me address this issue, as I don't understand Serde / Rust well enough yet.
This is also the reason why I didn't add any tests for this feature yet.
Thanks!