From 6d598667b82bdde9eba6e4e7255cffa820c80254 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:08:29 -0500 Subject: [PATCH] update names and paths --- crates/nu-cli/tests/completions/mod.rs | 4 ++-- crates/nu-protocol/src/eval_const.rs | 10 ++++++---- crates/nu-utils/src/sample_config/default_env.nu | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/nu-cli/tests/completions/mod.rs b/crates/nu-cli/tests/completions/mod.rs index 66d2259e7c..107de98c80 100644 --- a/crates/nu-cli/tests/completions/mod.rs +++ b/crates/nu-cli/tests/completions/mod.rs @@ -766,10 +766,10 @@ fn variables_completions() { assert_eq!(17, suggestions.len()); let expected: Vec = vec![ - "cache-path".into(), + "cache-dir".into(), "config-path".into(), "current-exe".into(), - "data-path".into(), + "data-dir".into(), "default-config-dir".into(), "env-path".into(), "history-enabled".into(), diff --git a/crates/nu-protocol/src/eval_const.rs b/crates/nu-protocol/src/eval_const.rs index 80521d9be9..9f81a6f38b 100644 --- a/crates/nu-protocol/src/eval_const.rs +++ b/crates/nu-protocol/src/eval_const.rs @@ -150,9 +150,10 @@ pub(crate) fn create_nu_constant(engine_state: &EngineState, span: Span) -> Valu ); record.push( - "data-path", + "data-dir", if let Some(path) = nu_path::data_dir() { - let canon_data_path = canonicalize_path(engine_state, &path); + let mut canon_data_path = canonicalize_path(engine_state, &path); + canon_data_path.push("nushell"); Value::string(canon_data_path.to_string_lossy(), span) } else { Value::error( @@ -165,9 +166,10 @@ pub(crate) fn create_nu_constant(engine_state: &EngineState, span: Span) -> Valu ); record.push( - "cache-path", + "cache-dir", if let Some(path) = nu_path::cache_dir() { - let canon_cache_path = canonicalize_path(engine_state, &path); + let mut canon_cache_path = canonicalize_path(engine_state, &path); + canon_cache_path.push("nushell"); Value::string(canon_cache_path.to_string_lossy(), span) } else { Value::error( diff --git a/crates/nu-utils/src/sample_config/default_env.nu b/crates/nu-utils/src/sample_config/default_env.nu index c0703dda9c..02dd6cd358 100644 --- a/crates/nu-utils/src/sample_config/default_env.nu +++ b/crates/nu-utils/src/sample_config/default_env.nu @@ -77,8 +77,8 @@ $env.ENV_CONVERSIONS = { # The default for this is $nu.default-config-dir/scripts $env.NU_LIB_DIRS = [ ($nu.default-config-dir | path join 'scripts') # add /scripts - ($nu.data-path | path join 'nushell' 'completions') # default home for nushell completions - ($nu.cache-path | path join 'nushell') # default home for nushell cache data, not used atm + ($nu.data-dir | path join 'completions') # default home for nushell completions + ($nu.cache-dir) # default home for nushell cache data, not used atm ] # Directories to search for plugin binaries when calling register