TreeTamer is a powerful bash script that flattens your project's directory structure, making it easier to manage and navigate complex project hierarchies. Tame your wild directory trees with ease! π―
- π Flattens directory structures while preserving all files
- π Handles filename collisions
- π« Excludes common directories by default (customizable)
- π Filters files by extension
- π Configurable symbolic link handling
- π Progress indication
- π² Generates a tree structure of the original project
curl -O https://raw.githubusercontent.com/gbechtold/TreeTamer/main/treetamer.sh./treetamer.sh [OPTIONS]-h, --help: π Display the help message-c, --clean: π§Ή Remove existing destination directory before flattening-e, --exclude: π« Comma-separated list of additional directories to exclude-i, --include: β Comma-separated list of directories to include (overrides default exclusions)-f, --filter: π Comma-separated list of file extensions to include-l, --links: π How to handle symbolic links: 'follow', 'preserve', or 'ignore' (default: ignore)
./treetamer.sh -c -e logs,temp -i node_modules -f js,py,txt -l preserveThis command will:
- π§Ή Clean the existing tamed tree directory
- π« Exclude 'logs' and 'temp' directories (in addition to default exclusions)
- β Include 'node_modules' directory (overriding its default exclusion)
- π Only include .js, .py, and .txt files
- π Preserve symbolic links
By default, TreeTamer excludes the following directories:
node_modules, target, .git, .idea, build, dist, venv, __pycache__
You can override these exclusions using the -i, --include option.
- Clone this repository:
git clone https://github.com/yourusername/TreeTamer.git - Make the script executable:
chmod +x treetamer.sh
Contributions are welcome! Please feel free to submit a Pull Request. π
This project is licensed under the MIT License - see the LICENSE file for details. π