From 909b7d2160ffbc4289b82c8090a196cb136ec712 Mon Sep 17 00:00:00 2001 From: Tanishq Kancharla Date: Sun, 3 Oct 2021 14:23:23 -0400 Subject: [PATCH] no-op --- crates/nu-command/src/core_commands/source.rs | 6 ++++-- crates/nu-parser/src/parse_keywords.rs | 2 ++ example.nu | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 example.nu diff --git a/crates/nu-command/src/core_commands/source.rs b/crates/nu-command/src/core_commands/source.rs index 677c6f5eda..76bcc461bb 100644 --- a/crates/nu-command/src/core_commands/source.rs +++ b/crates/nu-command/src/core_commands/source.rs @@ -1,6 +1,8 @@ +use std::path::Path; + use nu_protocol::ast::Call; 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. pub struct Source; @@ -27,7 +29,7 @@ impl Command for Source { _context: &EvaluationContext, call: &Call, input: Value, - ) -> Result { + ) -> Result { Ok(Value::Nothing { span: call.head }) // source(_context, call, input) } diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index 1700a71ce8..ffce2acc40 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -581,6 +581,8 @@ pub fn parse_source( // None, // ); } + } else { + // Source file couldn't be parsed correctly } } } diff --git a/example.nu b/example.nu new file mode 100644 index 0000000000..6a1392318a --- /dev/null +++ b/example.nu @@ -0,0 +1,5 @@ +def greet [name] { + echo "hello" $name +} + +greet "world" \ No newline at end of file