Allow NU_LIBS_DIR and friends to be const (#8538)

This commit is contained in:
StevenDoesStuffs
2023-04-05 11:56:48 -05:00
committed by GitHub
parent d18cf19a3f
commit 1134c2f16c
13 changed files with 279 additions and 136 deletions

View File

@ -1,4 +1,4 @@
use nu_engine::{find_in_dirs_env, CallExt};
use nu_engine::{find_in_dirs_env, get_dirs_var_from_call, CallExt};
use nu_parser::{parse, parse_module_block, unescape_unquote_string};
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack, StateWorkingSet};
@ -106,7 +106,12 @@ impl Command for NuCheck {
_ => {
if let Some(path_str) = path {
// look up the path as relative to FILE_PWD or inside NU_LIB_DIRS (same process as source-env)
let path = match find_in_dirs_env(&path_str.item, engine_state, stack) {
let path = match find_in_dirs_env(
&path_str.item,
engine_state,
stack,
get_dirs_var_from_call(call),
) {
Ok(path) => {
if let Some(path) = path {
path