Add a config variable with engine support (#332)

* Add a config variable with engine support

* Add a config variable with engine support

* Oops, cleanup
This commit is contained in:
JT
2021-11-15 08:25:57 +13:00
committed by GitHub
parent e76451866d
commit 0f107b2830
30 changed files with 333 additions and 96 deletions

View File

@ -2,7 +2,7 @@ use nu_engine::eval_block;
use nu_parser::parse;
use nu_protocol::{
engine::{Command, EngineState, Stack, StateWorkingSet},
PipelineData, Span,
PipelineData, Span, Value, CONFIG_VARIABLE_ID,
};
use crate::To;
@ -57,6 +57,16 @@ pub fn test_examples(cmd: impl Command + 'static) {
let mut stack = Stack::new();
// Set up our initial config to start from
stack.vars.insert(
CONFIG_VARIABLE_ID,
Value::Record {
cols: vec![],
vals: vec![],
span: Span::unknown(),
},
);
match eval_block(
&engine_state,
&mut stack,