nushell/crates/nu-cli/src
Yash Thakur a7b281292d
Canonicalize config dir (#12136)
It turns out that my previous PR,
https://github.com/nushell/nushell/pull/11999, didn't properly
canonicalize `$nu.default-config-dir` in a scenario where
`XDG_CONFIG_HOME` (or the equivalent on each platform) was a symlink. To
remedy that, this PR makes `nu_path::config_dir()` return a
canonicalized path. This probably shouldn't break anything (except maybe
tests relying on the old behavior), since the canonical path will be
equivalent to non-canonical paths.

# User-Facing Changes

A user may get a path with symlinks resolved and `..`s replaced where
they previously didn't. I'm not sure where this would happen, though,
and anyway, the canonical path is probably the "correct" thing to
present to the user. We're using `omnipath` to make the path presentable
to the user on Windows, so there's no danger of someone getting an path
with `\\?` there.

# Tests + Formatting

The tests for config files have been updated to run the binary using the
`Director` so that it has access to the `XDG_CONFIG_HOME`/`HOME`
environment variables to be able to change the config directory.
2024-03-10 11:07:31 +01:00
..
commands Add ConfigDirNotFound error (#11849) 2024-02-26 15:42:20 +08:00
completions Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
menus Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
config_files.rs Canonicalize config dir (#12136) 2024-03-10 11:07:31 +01:00
eval_cmds.rs Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
eval_file.rs Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
lib.rs Bump Reedline for the Menu Refactor (#11658) 2024-01-28 08:26:03 -08:00
nu_highlight.rs Allow for stacks to have parents (#11654) 2024-03-09 17:55:39 +01:00
print.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
prompt.rs fix shell integration markers (#11352) 2023-12-16 20:12:34 -06:00
prompt_update.rs Allow for stacks to have parents (#11654) 2024-03-09 17:55:39 +01:00
reedline_config.rs Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
repl.rs Allow for stacks to have parents (#11654) 2024-03-09 17:55:39 +01:00
syntax_highlight.rs Support redirect stderr and stdout+stderr with a pipe (#11708) 2024-02-09 01:30:46 +08:00
util.rs Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00