File size: 807 Bytes
4d10530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
setlocal
cd /d "%~dp0"

set "SCRIPT=%~dp0scripts\scratch_cleanup.py"
set "PYEXE=%~dp0venv\Scripts\python.exe"
if not exist "%PYEXE%" set "PYEXE=python"

"%PYEXE%" --version >nul 2>&1
if %errorlevel% neq 0 (
    echo [!] Python not found. Install Python or recreate the project venv first.
    pause
    exit /b 1
)

if /I "%~1"=="--yes" (
    "%PYEXE%" "%SCRIPT%" --apply
    set "EXIT_CODE=%errorlevel%"
    pause
    exit /b %EXIT_CODE%
)

echo [*] Preview scratch cleanup targets...
"%PYEXE%" "%SCRIPT%" --dry-run
if %errorlevel% neq 0 (
    pause
    exit /b %errorlevel%
)

echo.
choice /M "Move all scratch targets to Recycle Bin"
if errorlevel 2 (
    echo [*] Cleanup canceled.
    pause
    exit /b 0
)

"%PYEXE%" "%SCRIPT%" --apply
set "EXIT_CODE=%errorlevel%"
pause
exit /b %EXIT_CODE%