Skip to content

Instantly share code, notes, and snippets.

@SlideeScherz
Created March 23, 2024 04:01
Show Gist options
  • Save SlideeScherz/c785ff14c702f5fccba19a5aa740efd4 to your computer and use it in GitHub Desktop.
Save SlideeScherz/c785ff14c702f5fccba19a5aa740efd4 to your computer and use it in GitHub Desktop.
generate-directory-tree
#!/bin/bash
tree=$(tree -tf --noreport -I '*~' --charset ascii $1 |
sed -e 's/| \+/ /g' -e 's/[|`]-\+/ */g' -e 's:\(* \)\(\(.*/\)\([^/]\+\)\):\1[\4](\2):g')
printf "# Project tree\n\n${tree}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment