gardebring / PowerColorLS

PowerShell script to display a colorized directory and file listing with icons
MIT License
61 stars 3 forks source link

Symbolic linked files are not listed when by PowerColorLS #10

Closed Drllap closed 2 years ago

Drllap commented 2 years ago

Script I used for testing:

mkdir test_folder
echo "some test text" >> test_file.txt
cd test_folder
New-Item -Name the_link -ItemType SymbolicLink -Value ../test_file.txt
PowerColorLS
Get-ChildItem

Calling PowerColorLS doesn't output anything: image

Get-ChildItem output: image

Modules and versions: image

Using:

Drllap commented 2 years ago

Looks like this only happens when the symbolic link is the only thing in the folder

Drllap commented 2 years ago

I found the issue here

If there is only one item in the path Get-ChildItem returns FileInfo. The Length member of FileInfo is the file size which is zero in the case of symbolic links.

A potential fix would just be to delete this if statement.

gardebring commented 2 years ago

Thank you @Drllap for your issue report and your excellent description including reproduction steps. I will look into this when I have a bit of time over :)

Drllap commented 2 years ago

I have created a pull request that fixes this: #11

gardebring commented 2 years ago

Hi @Drllap . Really appreciate the PR! However, I had already fixed this in a different branch, just didn't get around to merge and actually deploy it up... Now version 1.0.4 is in the main branch and also deployed to Powershell Gallery. Please let me know if there are any issues still :)