This commit is contained in:
Tanishq Kancharla 2021-10-03 14:23:23 -04:00
parent 9e7285ad46
commit 909b7d2160
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,8 @@
use std::path::Path;
use nu_protocol::ast::Call; use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EvaluationContext}; use nu_protocol::engine::{Command, EvaluationContext};
use nu_protocol::{Signature, SyntaxShape, Value}; use nu_protocol::{ShellError, Signature, SyntaxShape, Value};
/// Source a file for environment variables. /// Source a file for environment variables.
pub struct Source; pub struct Source;
@ -27,7 +29,7 @@ impl Command for Source {
_context: &EvaluationContext, _context: &EvaluationContext,
call: &Call, call: &Call,
input: Value, input: Value,
) -> Result<nu_protocol::Value, nu_protocol::ShellError> { ) -> Result<Value, ShellError> {
Ok(Value::Nothing { span: call.head }) Ok(Value::Nothing { span: call.head })
// source(_context, call, input) // source(_context, call, input)
} }

View File

@ -581,6 +581,8 @@ pub fn parse_source(
// None, // None,
// ); // );
} }
} else {
// Source file couldn't be parsed correctly
} }
} }
} }

5
example.nu Normal file
View File

@ -0,0 +1,5 @@
def greet [name] {
echo "hello" $name
}
greet "world"