mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-06 22:10:14 -03:00
Move settings.json, civitai/, wildcards/, backups/, stats/, logs/, cache/, and model_cache/ to a temp directory before git reset/clean or ZIP replacement, then restore them in a try/finally block. This prevents data loss on Windows where git clean -e exclusion patterns can fail due to path-separator mismatches or where file locks (open SQLite/log handles) cause the restore step to be skipped on failure. Also unifies three hardcoded skip lists (_clean_plugin_folder, skip_items, skip_tracked) to derive from the single _PRESERVE_DIRS constant, fixing drift where logs/ was missing from the ZIP path.