update names and paths

This commit is contained in:
Darren Schroeder 2024-06-10 19:08:29 -05:00
parent 4d974a4f6b
commit 6d598667b8
3 changed files with 10 additions and 8 deletions

View File

@ -766,10 +766,10 @@ fn variables_completions() {
assert_eq!(17, suggestions.len());
let expected: Vec<String> = 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(),

View File

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

View File

@ -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 <nushell-config-dir>/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