(&self, args: &[Value], _context: &Context)
| 27 | } |
| 28 | |
| 29 | fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> { |
| 30 | if let Ok(val) = env::var(args[0].as_str().unwrap_or_default()) { |
| 31 | return Ok(Value::String(val)); |
| 32 | } |
| 33 | |
| 34 | Err(DscError::Function("envvar".to_string(), t!("functions.envvar.notFound").to_string())) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | #[cfg(test)] |