tree
tree copied to clipboard
Add bash supporting hidden files
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.
-
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. -
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)
Anyway, Cheers and thanks for making the project! Michael Dimmitt