pls-rs / pls

`pls` is a prettier and powerful `ls(1)` for the pros.
https://pls.cli.rs/
GNU General Public License v3.0
830 stars 24 forks source link

Error when running in folders like /etc #5

Closed aeagiraldelli closed 2 years ago

aeagiraldelli commented 2 years ago

First of all congratulations for the excellent work.

Problem

When I run the pls command in a folder like /etc or /dev I'm getting this error.

Traceback (most recent call last):
  File "/home/aeagiraldelli/.local/bin/pls", line 8, in <module>
    sys.exit(main())
  File "/home/aeagiraldelli/.local/lib/python3.8/site-packages/pls/main.py", line 16, in main
    nodes = read_input()
  File "/home/aeagiraldelli/.local/lib/python3.8/site-packages/pls/fs/list.py", line 82, in read_input
    all_nodes.sort(key=sort_key, reverse=args.sort == SortOrder.DESC)
  File "/home/aeagiraldelli/.local/lib/python3.8/site-packages/pls/fs/list.py", line 31, in sort_key
    prefix = "0" if node.node_type == NodeType.DIR else "1"
  File "/usr/lib/python3.8/functools.py", line 967, in __get__
    val = self.func(instance)
  File "/home/aeagiraldelli/.local/lib/python3.8/site-packages/pls/models/node.py", line 93, in node_type
    self.dest_node = Node(name=link_path, path=link)
TypeError: __init__() missing 1 required positional argument: 'state'

Steps to reproduce

open a terminal

cd /etc
pls --details

Extra information

I'm using

I installed pls using pipx

pipx list

venvs are in /home/aeagiraldelli/.local/pipx/venvs
apps are exposed on your $PATH at /home/aeagiraldelli/.local/bin
   package glances 3.2.4.2, installed using Python 3.8.10
    - glances
   package pls 1.8.0, installed using Python 3.8.10
    - pls
dhruvkb commented 2 years ago

Thanks for reporting this. I just released version 1.8.1 with commit a2ec4e6 that should fix this bug.

aeagiraldelli commented 2 years ago

Thanks for responding so quickly. I can confirm that the issue has been resolved.