Error make (#948)

* Add `error make` and improve `metadata`

* Allow metadata to work on just a pipeline
This commit is contained in:
JT
2022-02-05 09:39:51 -05:00
committed by GitHub
parent e45e8109aa
commit 8a93548de2
5 changed files with 241 additions and 39 deletions

View File

@ -65,6 +65,14 @@ impl Stack {
Err(ShellError::VariableNotFoundAtRuntime(span))
}
pub fn get_var_with_origin(&self, var_id: VarId, span: Span) -> Result<Value, ShellError> {
if let Some(v) = self.vars.get(&var_id) {
return Ok(v.clone());
}
Err(ShellError::VariableNotFoundAtRuntime(span))
}
pub fn add_var(&mut self, var_id: VarId, value: Value) {
self.vars.insert(var_id, value);
}