tree icon indicating copy to clipboard operation
tree copied to clipboard

Add bash supporting hidden files

Open MichaelDimmitt opened this issue 2 years ago • 0 comments

Hello!

I needed a simple implementation of tree in an environment that did not have a package manager

Therefore, I found this project helpful!

But the file system had a bunch of hidden files and folders so I needed tree to have the -a option.

This pr has 2 changes. I am happy to break this up or feel free to make any changes you find prudent.

  1. Testing:
    a. I noticed that there is an executable for testing at bin/test.
    b. However, it did not work on my machine. c. So, I added a test folder with some example files and folders.

  2. Added support for a -a flag to the bash implementation that will show hidden files.

In a future pr I could add the following change: wrap the entire file in a function:

_tree() {
  # ... code here
}
_tree "$@"

That way the file can be sourced and future implementations can just run _tree <whatever> Or you could copy and paste without needing to source the file.

The result of these two changes is outlined in the following screenshot: (instructions on how to get these results have been added to the readme)

Screenshot 2023-11-15 at 3 52 16 PM

Anyway, Cheers and thanks for making the project! Michael Dimmitt

MichaelDimmitt avatar Nov 15 '23 21:11 MichaelDimmitt