$ show imjp94/gd-plug
gd-plug is a plugin manager for Godot 4.x, inspired by vim-plug. It provides a command-line interface to install, update, and uninstall Godot plugins (Git repositories) based on declarations in a `plug.gd` configuration file. The tool supports parallel operations, version freezing (by branch, tag, or commit), development vs. production modes, and clean uninstallation. The architecture centers around a single script (`plug.gd`) that extends Godot's SceneTree, processing command-line arguments and managing plugin lifecycle through Git operations and file system manipulations. Key features include dependency tracking via a local configuration file, threaded parallelism for efficient operations, and robust file handling with safety checks to prevent overwriting user files.
The LLM identified 3 files worth highlighting for reuse:
The _Logger class provides a flexible logging mechanism with support for multiple log levels (DEBUG, INFO, WARN, ERROR, NONE), customizable output formats, and indentation control. It is self-contained, relying only on Godot's OS and print functions, making it easily extractable for use in any Godot project requiring structured logging.
The _ThreadPool class implements a reusable thread pool that manages a set of worker threads, queues tasks with priority, and waits for completion. It handles thread lifecycle, task execution, and synchronization internally, demonstrating solid concurrent programming principles. This component can be reused in any Godot application needing parallel execution of tasks without modifying the core logic.
A set of file operation utilities (directory_copy_recursively, directory_delete_recursively, directory_remove_batch) provides robust, recursive file system manipulation with features like include/exclude filtering, test mode (dry-run), and safe handling of associated files (e.g., .import files). These functions are self-contained, handle edge cases (such as read-only files or Git metadata), and can be extracted for use in other Godot tools requiring reliable file management.