nushell/crates/nu-path/src
Devyn Cairns 709b2479d9
Fix trailing slash in PWD set by cd (#12760)
# Description

Fixes #12758.

#12662 introduced a bug where calling `cd` with a path with a trailing
slash would cause `PWD` to be set to a path including a trailing slash,
which is not allowed. This adds a helper to `nu_path` to remove this,
and uses it in the `cd` command to clean it up before setting `PWD`.

# Tests + Formatting
I added some tests to make sure we don't regress on this in the future.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-05-04 12:38:37 +03:00
..
assert_path_eq.rs Path expansion no longer removes trailing slashes (#12662) 2024-05-01 17:28:54 -05:00
components.rs Fix trailing slash in PWD set by cd (#12760) 2024-05-04 12:38:37 +03:00
dots.rs Path expansion no longer removes trailing slashes (#12662) 2024-05-01 17:28:54 -05:00
expansions.rs Accept filenames in other plugin management commands (#12639) 2024-04-24 06:28:45 -05:00
helpers.rs Use XDG_CONFIG_HOME before default config directory (#12118) 2024-03-11 06:15:46 -05:00
lib.rs Fix trailing slash in PWD set by cd (#12760) 2024-05-04 12:38:37 +03:00
tilde.rs Path expansion no longer removes trailing slashes (#12662) 2024-05-01 17:28:54 -05:00
trailing_slash.rs Fix trailing slash in PWD set by cd (#12760) 2024-05-04 12:38:37 +03:00