-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
57 lines (50 loc) · 1.25 KB
/
run.bat
File metadata and controls
57 lines (50 loc) · 1.25 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
setlocal
set BINARY=aifiler.exe
if not "%~1"=="" goto :run_with_args
:menu
cls
echo ==========================================
echo Aifiler CLI - Quick Actions
echo ==========================================
echo 1. Run aifiler (Standard)
echo 2. Build / Rebuild
echo 3. Exit
echo ==========================================
set /p choice="Choose an option (1-3): "
if "%choice%"=="1" goto :run_default
if "%choice%"=="2" goto :build
if "%choice%"=="3" goto :exit
goto :menu
:run_default
if not exist "%BINARY%" call :build
"%BINARY%"
pause
goto :menu
:run_with_args
if not exist "%BINARY%" call :build
"%BINARY%" %*
exit /b %ERRORLEVEL%
:build
powershell -Command "Write-Host 'Tidying Go dependencies...' -ForegroundColor Cyan"
go mod tidy
if %ERRORLEVEL% neq 0 (
powershell -Command "Write-Host 'X go mod tidy failed' -ForegroundColor Red"
pause
goto :menu
)
powershell -Command "Write-Host 'Building aifiler...' -ForegroundColor Cyan"
go build -o %BINARY% ./cmd/aifiler
if %ERRORLEVEL% neq 0 (
powershell -Command "Write-Host 'Build failed' -ForegroundColor Red"
pause
goto :menu
)
powershell -Command "Write-Host 'Successfully built %BINARY%' -ForegroundColor Green"
if "%~1"=="" (
pause
goto :menu
)
goto :eof
:exit
exit /b 0