mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:55:55 +02:00
WIP
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use nu_engine::{eval_block, CallExt};
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{Command, EvaluationContext};
|
||||
use nu_protocol::engine::{Command, EngineState, EvaluationContext, Stack};
|
||||
use nu_protocol::{PipelineData, ShellError, Signature, SyntaxShape, Value};
|
||||
|
||||
/// Source a file for environment variables.
|
||||
@ -26,15 +26,16 @@ impl Command for Source {
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
context: &EvaluationContext,
|
||||
engine_state: &EngineState,
|
||||
stack: &mut Stack,
|
||||
call: &Call,
|
||||
input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
// Note: this hidden positional is the block_id that corresponded to the 0th position
|
||||
// it is put here by the parser
|
||||
let block_id: i64 = call.req(context, 1)?;
|
||||
let block_id: i64 = call.req(engine_state, stack, 1)?;
|
||||
|
||||
let block = context.engine_state.get_block(block_id as usize).clone();
|
||||
eval_block(context, &block, input)
|
||||
let block = engine_state.get_block(block_id as usize).clone();
|
||||
eval_block(engine_state, stack, &block, input)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user