mirror of
https://github.com/Gerald-Ha/GGTree.git
synced 2025-04-02 12:13:17 +00:00
GGTree is a simple Python program that outputs the directory structure (tree) from the current folder to the console.
ggtree.py | ||
install.bat | ||
install.sh | ||
LICENSE | ||
README.md | ||
uninstall.bat | ||
uninstall.sh |
GGTree
GGTree is a simple Python program that displays the directory structure (a tree) starting from the current directory in your console.
Example
User: /python/tree$ ggtree
Directory tree for: /python/tree
├── README.md
├── README.md~
├── TestFolder1
│ └── test.txt
├── ggtree.py
├── install.sh
└── uninstall.sh
User: /python/tree$
Features
- Provides a clear tree visualization of all files and subdirectories.
- Runs directly from the current directory.
- Easy to install and uninstall.
Prerequisites
- Python 3 must be installed on your system.
Installation (Linux/macOS)
- Download the files
ggtree.py
,install.sh
, anduninstall.sh
. - Navigate to the directory where these files are located.
- Ensure the scripts have the correct permissions:
chmod +x install.sh uninstall.sh
- Run the installation script:
sudo ./install.sh
Note
: Using
sudo
may be required to place files in global directories and possibly adjust thePATH
environment variable.
After the installation, you can run ggtree
from any directory in a new terminal window.
Installation (Windows)
- Make sure Python 3 is installed and added to your system
PATH
. - Download the files
ggtree.py
,install.bat
, anduninstall.bat
. - Double-click (or run in Command Prompt)
install.bat
:- This script copies
ggtree.py
and creates a wrapper batch fileggtree.bat
in
%USERPROFILE%\AppData\Local\Programs\ggtree
. - It then updates your
PATH
environment variable so you can runggtree
from anywhere.
- This script copies
- Open a new Command Prompt or PowerShell window so that the updated
PATH
variable is recognized.
Note
: If you prefer a custom location, adjust the script and manually configure your
PATH
environment variable accordingly.
Usage
Linux/macOS
Simply open a terminal and run:
ggtree
The program will display the directory structure starting from your current folder.
Windows
- If you used
install.bat
and have opened a new terminal window, you can directly run:ggtree
- If you did not install or it’s not in the PATH:
(In this case, you must be in the same directory aspython ggtree.py
ggtree.py
, or specify the full path.)
Uninstallation
Linux/macOS
- Run the
uninstall.sh
script:sudo ./uninstall.sh
- This removes the program and any related files (including symlinks/entries in your system paths).
Windows
- Double-click (or run)
uninstall.bat
:- This script deletes
ggtree.py
and theggtree.bat
file from
%USERPROFILE%\AppData\Local\Programs\ggtree
. - It then tries to remove that entire directory.
- This script deletes
- Note: This does not automatically remove the entry from the
PATH
environment variable.
If you want a fully cleaned environment, you must manually remove the corresponding entry from yourPATH
or modify the script to do so.
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE
file for more details.
Enjoy using GGTree!