mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
FIX: load the library before anything else (#8774)
This commit is contained in:
parent
74283c3ebc
commit
d93953a56f
13
src/run.rs
13
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,
|
||||
|
Loading…
Reference in New Issue
Block a user