Last active
August 29, 2015 14:04
-
-
Save iamaziz/45688ef2767d33d4bd50 to your computer and use it in GitHub Desktop.
Script to create an html page as a tree of current directory, based on tree: http://mama.indstate.edu/users/ice/tree/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create a tree of current directory in an html page `readme.html` | |
# to use it: place treeme.sh somewhere and add it your path | |
# (add/remove any extension to EXECLUDE to be displayed/execluded) | |
TITLE="Tree of:" | |
PWD=$(pwd) | |
OUTPUT="readme.html" | |
if [[ -n "$1" ]]; then # if output file name is provided | |
OUTPUT="$1"; | |
fi | |
EXECLUDE="readme.html|*.class|*.gif|*.jar|*.png|*.ipynb|*.csv|*.RData|*.pyc|*.ico|*.svg|*.ttf|*.eot|*.woff|*.dll|*.nupkg|" | |
tree -H . -T "$TITLE $PWD" -C --dirsfirst -o "$OUTPUT" -I "$EXECLUDE" --filelimit 40 | |
printf "Treed the folder: $PWD\nEnjoy browsing it in $OUTPUT"; | |
open "$OUTPUT"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment