Skip to content

Commit

Permalink
fix(core): Add log trace for extend vars
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Gil <[email protected]>
  • Loading branch information
pando85 committed Sep 14, 2023
1 parent d7a8b6c commit 37551b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rash_core/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ impl Task {
}

#[inline(always)]
fn extended_vars(&self, vars: Vars) -> Result<Vars> {
fn extend_vars(&self, vars: Vars) -> Result<Vars> {
match self.vars.clone() {
Some(v) => {
let mut e_vars = vars.clone();
trace!("extend vars: {:?}", &v);
e_vars.extend(Vars::from_serialize(render(v, &vars)?)?);
Ok(e_vars)
}
Expand All @@ -120,7 +121,7 @@ impl Task {
}

fn render_params(&self, vars: Vars) -> Result<Value> {
let extended_vars = self.extended_vars(vars)?;
let extended_vars = self.extend_vars(vars)?;

let original_params = self.params.clone();
match original_params {
Expand Down Expand Up @@ -160,7 +161,7 @@ impl Task {
trace!("when: {:?}", &self.when);
match &self.when {
Some(s) => {
let extended_vars = self.extended_vars(vars.clone())?;
let extended_vars = self.extend_vars(vars.clone())?;
is_render_string(s, &extended_vars)
}
None => Ok(true),
Expand Down

0 comments on commit 37551b6

Please sign in to comment.