Update
This commit is contained in:
@@ -1,37 +1,53 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
echo ========================================
|
||||
echo NexusLauncher Cache Cleaner
|
||||
echo Nexus Cache Cleaner
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
@REM echo Close NexusLauncher if it is running...
|
||||
@REM taskkill /f /im pythonw.exe
|
||||
echo Starting cache cleanup...
|
||||
echo.
|
||||
|
||||
echo [1/4] Cleaning all __pycache__ folders...
|
||||
for /d /r %%d in (__pycache__) do @if exist "%%d" (
|
||||
REM 计数器初始化
|
||||
set "pycache_count=0"
|
||||
set "temp_count=0"
|
||||
|
||||
REM 清理 Python __pycache__ 目录
|
||||
echo [1/2] Cleaning Python cache files...
|
||||
for /f "delims=" %%d in ('dir /s /b /ad __pycache__ 2^>nul') do (
|
||||
echo Deleting: %%d
|
||||
rd /s /q "%%d"
|
||||
rd /s /q "%%d" 2>nul
|
||||
if !errorlevel! equ 0 (
|
||||
set /a pycache_count+=1
|
||||
)
|
||||
)
|
||||
|
||||
REM 清理临时文件
|
||||
echo [2/2] Cleaning temporary files...
|
||||
for %%ext in (*.tmp *.temp *.pyc *.pyo) do (
|
||||
for /f "delims=" %%f in ('dir /s /b "%%ext" 2^>nul') do (
|
||||
echo Deleting: %%f
|
||||
del /f /q "%%f" 2>nul
|
||||
if !errorlevel! equ 0 (
|
||||
set /a temp_count+=1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
echo [2/4] Cleaning root cache...
|
||||
if exist "__pycache__" rd /s /q "__pycache__"
|
||||
echo.
|
||||
|
||||
echo [3/4] Cleaning module caches...
|
||||
if exist "config\__pycache__" rd /s /q "config\__pycache__"
|
||||
if exist "ui\__pycache__" rd /s /q "ui\__pycache__"
|
||||
if exist "ui\task\__pycache__" rd /s /q "ui\task\__pycache__"
|
||||
echo.
|
||||
|
||||
echo [4/4] Cleaning .pyc files...
|
||||
del /s /q *.pyc 2>nul
|
||||
echo.
|
||||
|
||||
@REM echo Clear old config file
|
||||
@REM if exist config.json del /f config.json
|
||||
|
||||
echo ========================================
|
||||
echo Cache cleaned successfully!
|
||||
echo Cleanup Summary:
|
||||
echo Python cache directories: !pycache_count!
|
||||
echo Temporary files: !temp_count!
|
||||
echo ========================================
|
||||
|
||||
if !pycache_count! gtr 0 (
|
||||
echo Cache cleanup completed successfully!
|
||||
) else if !temp_count! gtr 0 (
|
||||
echo Temporary files cleanup completed!
|
||||
) else (
|
||||
echo No cache files found to clean.
|
||||
)
|
||||
|
||||
echo.
|
||||
pause
|
||||
Reference in New Issue
Block a user