From 2dcb16870b0d8ebc20f4822a72c89a4103b992bc Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Fri, 8 Jan 2021 19:36:31 +1300 Subject: [PATCH] Treat all the startup commands as a single script file (#2890) --- crates/nu-cli/src/cli.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index cc1e213a4c..4716794f3a 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -359,11 +359,12 @@ async fn run_startup_commands( value: UntaggedValue::Table(pipelines), .. } => { + let mut script_file = String::new(); for pipeline in pipelines { - if let Ok(pipeline_string) = pipeline.as_string() { - let _ = run_script_standalone(pipeline_string, false, context, false).await; - } + script_file.push_str(&pipeline.as_string()?); + script_file.push('\n'); } + let _ = run_script_standalone(script_file, false, context, false).await; } _ => { return Err(ShellError::untagged_runtime_error(