forked from extern/nushell
Add virtual path abstraction layer (#9245)
This commit is contained in:
24
src/main.rs
24
src/main.rs
@@ -152,6 +152,18 @@ fn main() -> Result<()> {
|
||||
engine_state.add_env_var("NU_LIB_DIRS".into(), Value::List { vals, span });
|
||||
}
|
||||
|
||||
start_time = std::time::Instant::now();
|
||||
// First, set up env vars as strings only
|
||||
gather_parent_env_vars(&mut engine_state, &init_cwd);
|
||||
perf(
|
||||
"gather env vars",
|
||||
start_time,
|
||||
file!(),
|
||||
line!(),
|
||||
column!(),
|
||||
use_color,
|
||||
);
|
||||
|
||||
if parsed_nu_cli_args.no_std_lib.is_none() {
|
||||
load_standard_library(&mut engine_state)?;
|
||||
}
|
||||
@@ -243,18 +255,6 @@ fn main() -> Result<()> {
|
||||
use_color,
|
||||
);
|
||||
|
||||
start_time = std::time::Instant::now();
|
||||
// First, set up env vars as strings only
|
||||
gather_parent_env_vars(&mut engine_state, &init_cwd);
|
||||
perf(
|
||||
"gather env vars",
|
||||
start_time,
|
||||
file!(),
|
||||
line!(),
|
||||
column!(),
|
||||
use_color,
|
||||
);
|
||||
|
||||
if let Some(commands) = parsed_nu_cli_args.commands.clone() {
|
||||
run_commands(
|
||||
&mut engine_state,
|
||||
|
@@ -2,15 +2,12 @@ use crate::tests::{fail_test, run_test_std, TestResult};
|
||||
|
||||
#[test]
|
||||
fn library_loaded() -> TestResult {
|
||||
run_test_std(
|
||||
"help std | lines | first 1 | to text",
|
||||
"std.nu, `used` to load all standard library components",
|
||||
)
|
||||
run_test_std("$nu.scope.modules | where name == 'std' | length", "1")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prelude_loaded() -> TestResult {
|
||||
run_test_std("std help commands | where name == open | length", "1")
|
||||
run_test_std("shells | length", "1")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user