-
Notifications
You must be signed in to change notification settings - Fork 286
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(tasks): make script task dirs configurable #1571
Conversation
774ce00
to
c0901bc
Compare
@@ -50,6 +50,8 @@ pub struct MiseToml { | |||
#[serde(default)] | |||
plugins: HashMap<String, String>, | |||
#[serde(skip)] | |||
pub task_config: TaskConfig, |
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.
can you change this to parse via derive? I'm trying to get rid of the manual parsing
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.
Yes, that's what I actually started with, but didn't quite understand how templates are being rendered to the deserialized values.
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.
nvm, I see now. Was looking in the wrong place.
mise/src/config/env_directive.rs
Lines 151 to 165 in 3070bf8
fn parse_template( | |
&self, | |
ctx: &tera::Context, | |
path: &Path, | |
input: &str, | |
) -> eyre::Result<String> { | |
if !input.contains("{{") && !input.contains("{%") && !input.contains("{#") { | |
return Ok(input.to_string()); | |
} | |
trust_check(path)?; | |
let dir = path.parent(); | |
let output = get_tera(dir) | |
.render_str(input, ctx) | |
.wrap_err_with(|| eyre!("failed to parse template: '{input}'"))?; | |
Ok(output) |
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.
Just dropping support for templating in includes
for now. It just adds too much noise for the moment and will be simpler to incorporate after custom parsing is gone.
c0901bc
to
1670484
Compare
1670484
to
5f50669
Compare
Summary
Closes #1270
Adds a top-level config Table,
task_config
, which currently has one propertyincludes
.includes
is an array of paths which can be used to alter the locations from which file tasks are loaded from.These paths can be absolute, relative, inside/outside the project, and accepts
~
as a substitution for$HOME
.Additional Notes
includes
is represented as aBTreeSet
to preserve ordering, allows users to influence load ordering, and to ensure uniqueness.