diff --git a/src/run.rs b/src/run.rs index a20a73095..fb6eb0827 100644 --- a/src/run.rs +++ b/src/run.rs @@ -113,6 +113,9 @@ pub(crate) fn run_commands( ) -> Result<(), miette::ErrReport> { let mut stack = nu_protocol::engine::Stack::new(); let start_time = std::time::Instant::now(); + + load_standard_library(engine_state)?; + #[cfg(feature = "plugin")] read_plugin_file( engine_state, @@ -163,8 +166,6 @@ pub(crate) fn run_commands( use_color, ); - load_standard_library(engine_state)?; - // Before running commands, set up the startup time engine_state.set_startup_time(entire_start_time.elapsed().as_nanos() as i64); let start_time = std::time::Instant::now(); @@ -202,6 +203,8 @@ pub(crate) fn run_file( let mut stack = nu_protocol::engine::Stack::new(); let start_time = std::time::Instant::now(); + load_standard_library(engine_state)?; + #[cfg(feature = "plugin")] read_plugin_file( engine_state, @@ -252,8 +255,6 @@ pub(crate) fn run_file( use_color, ); - load_standard_library(engine_state)?; - let start_time = std::time::Instant::now(); let ret_val = evaluate_file( script_name, @@ -301,6 +302,8 @@ pub(crate) fn run_repl( let mut stack = nu_protocol::engine::Stack::new(); let start_time = std::time::Instant::now(); + load_standard_library(engine_state)?; + if parsed_nu_cli_args.no_config_file.is_none() { setup_config( engine_state, @@ -324,8 +327,6 @@ pub(crate) fn run_repl( use_color, ); - load_standard_library(engine_state)?; - let start_time = std::time::Instant::now(); let ret_val = evaluate_repl( engine_state,