run_external.rs: use pathdiff::diff_path to handle relative path#13056
run_external.rs: use pathdiff::diff_path to handle relative path#13056WindSoilder merged 4 commits intonushell:mainfrom
Conversation
| assert_eq!(actual, expected); | ||
|
|
||
| let actual = expand_glob("./*.txt", cwd, Span::unknown(), &None).unwrap(); | ||
| let expected = vec![ |
There was a problem hiding this comment.
I wrote this test intentionally - it should include the ./, because if the user specified that in their glob, they probably expect it in the output.
devyn
left a comment
There was a problem hiding this comment.
I think removing the test for ./*.txt → [./a.txt ./b.txt] is incorrect - that should intentionally glob that way. Maybe we weren't doing that before though?
No, we just remove |
|
Sometimes it does matter - for example if you were trying to make an executable path. But I agree it usually doesn't |
I'm okay with whatever you decide - if this makes it easier then let's do it
|
...but it would be nice to have this in a utility function so we can reuse it. |
Sure, It's a good advice! I added |
|
I'm totally ok with long names if they're accurate 😄 |
Description
This pr is going to use
pathdiff::diff_path, so we don't need to handle for relative path by ourselves.This is also the behavior before the rewritten of run_external.rs
It's a follow up to #13028
User-Facing Changes
NaN
Tests + Formatting
No need to add tests