nushell/crates/nu-command/src/filesystem
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
..
cd.rs Fix trailing slash in PWD set by cd (#12760) 2024-05-04 12:38:37 +03:00
du.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
glob.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
ls.rs Report errors that occur on file operations in ls (#12033) 2024-05-03 10:12:43 -05:00
mktemp.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
mod.rs remove old mv command in favor of umv (renamed to mv) (#12022) 2024-03-01 09:37:23 +08:00
open.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
rm.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
save.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
start.rs Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
touch.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
ucp.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
umkdir.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
umv.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00
util.rs making ls and du supports rest parameters. (#12327) 2024-04-13 15:03:17 +00:00
watch.rs Migrate to a new PWD API (#12603) 2024-05-03 14:33:09 +03:00