Extract a symlink's target type if possible, so it can have proper colors.#563
Extract a symlink's target type if possible, so it can have proper colors.#563dsully wants to merge 1 commit intolsd-rs:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #563 +/- ##
==========================================
- Coverage 86.73% 86.38% -0.36%
==========================================
Files 37 37
Lines 3800 3819 +19
==========================================
+ Hits 3296 3299 +3
- Misses 504 520 +16
Continue to review full report at Codecov.
|
|
oh, my bad, I got you wrong! could you add some tests for this feature and we can pass the CI |
|
Hey, what sort of tests would you like? Since it's pretty much just pattern matching. |
| @@ -120,6 +151,7 @@ mod tests { | |||
| fn test_symlink_render_default_invalid_target_withcolor() { | |||
There was a problem hiding this comment.
like the test here, it checks the invalid target color, IMO, you can add some tests like this testing some of newly added cases
There was a problem hiding this comment.
Maybe It looks a little dumb by adding tests for pattern matching, but this is how we kept the functionalities working as expected during the code changes.
|
We should probably colors the items using lscolors and not just builtin colors. |
|
@meain the coloring is using the default mechanism, it would already use the LSCOLOR if I get the coloring logic right. |
|
Ahh, my bad I misread what the code was doing. @dsully I found a small issue in the code. If the symlink is relative and we are not calling lsd from the same directory that it was symlinked from, it does not work. |
|
Ok, I'll take a look. |
Extract a symlink's target type if possible, so it can have proper colors.
Before:

After:
cargo fmt