diff --git a/crates/nu-cli/src/app.rs b/crates/nu-cli/src/app.rs index 68cf85f0a4..55a35c6ce8 100644 --- a/crates/nu-cli/src/app.rs +++ b/crates/nu-cli/src/app.rs @@ -110,16 +110,19 @@ impl App { } if let Some(scripts) = self.scripts() { - let source_files = scripts - .into_iter() - .filter_map(Result::ok) - .map(|path| { - let path = std::ffi::OsString::from(path); + let mut source_files = vec![]; + for script in scripts { + let script_name = script?; + let path = std::ffi::OsString::from(&script_name); - NuScript::source_file(path.as_os_str()) - }) - .filter_map(Result::ok) - .collect::>(); + match NuScript::source_file(path.as_os_str()) { + Ok(file) => source_files.push(file), + Err(_) => { + eprintln!("File not found: {}", script_name); + return Ok(()); + } + } + } for file in source_files { let mut opts = opts.clone(); diff --git a/crates/nu-command/src/commands/dataframe/filter.rs b/crates/nu-command/src/commands/dataframe/filter.rs index e63835c771..59d11d8a6d 100644 --- a/crates/nu-command/src/commands/dataframe/filter.rs +++ b/crates/nu-command/src/commands/dataframe/filter.rs @@ -50,7 +50,7 @@ fn command(mut args: CommandArgs) -> Result { let tag = args.call_info.name_tag.clone(); let value: Value = args.req(1)?; - let series_span = value.tag.span.clone(); + let series_span = value.tag.span; let series = match value.value { UntaggedValue::DataFrame(PolarsData::Series(series)) => Ok(series), _ => Err(ShellError::labeled_error(