Add virtual path abstraction layer (#9245)

This commit is contained in:
Jakub Žádník
2023-05-23 23:48:50 +03:00
committed by GitHub
parent db4b26c1ac
commit 74724dee80
19 changed files with 500 additions and 323 deletions

View File

@@ -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,

View File

@@ -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]