nushell/crates/nu-command/tests
Wind 217eb4ed70
fix path exists on a non-directory file (#13763)
# Description
Fixes:  #13460

The issue is caused by `try_exists` method on path, it will return
`Err(NotADirectory)` if user tried to check for a path under a regular
file.
To fix it, I think it's ok to use `exists` rather than `try_exists`,
although
[Path::exists()](https://doc.rust-lang.org/std/path/struct.Path.html#method.exists)
only checks whether or not a path was both found and readable. I think
it's ok, and we can add this information under `extra_description`.

# User-Facing Changes
The following code will no longer raise error:
```
touch a; 'a/b' | path exists
```

# Tests + Formatting
Added 1 test.
2024-09-11 12:45:39 -05:00
..
commands fix path exists on a non-directory file (#13763) 2024-09-11 12:45:39 -05:00
format_conversions Make the subcommands (from {csv, tsv, ssv}) 0-based for consistency (#13209) 2024-06-26 17:51:47 -05:00
main.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00