-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
64 lines (58 loc) · 1.74 KB
/
build.bat
File metadata and controls
64 lines (58 loc) · 1.74 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
58
59
60
61
62
63
64
@echo off
echo ============================================
echo CUIck Scan — Build Script
echo ============================================
echo.
echo [1/5] Installing npm dependencies...
cd ClientApp
call npm install
if errorlevel 1 (
echo ERROR: npm install failed.
pause
exit /b 1
)
echo.
echo [2/5] Building React frontend...
call npm run build
if errorlevel 1 (
echo ERROR: React build failed.
pause
exit /b 1
)
cd ..
echo.
echo [3/5] Copying built files to wwwroot...
if not exist wwwroot mkdir wwwroot
REM Clean old hashed JS bundles and stale source files to prevent conflicts
if exist wwwroot\assets\index-*.js del /Q wwwroot\assets\index-*.js
if exist wwwroot\App.jsx del /Q wwwroot\App.jsx
xcopy /E /Y /Q ClientApp\dist\* wwwroot\
echo.
echo [4/5] Building .NET project...
REM Clean stale JS bundles and source files from output to prevent hash mismatch
if exist bin\x64\wwwroot\assets\index-*.js del /Q bin\x64\wwwroot\assets\index-*.js
if exist bin\x64\wwwroot\App.jsx del /Q bin\x64\wwwroot\App.jsx
dotnet build -c Release
if errorlevel 1 (
echo ERROR: dotnet build failed.
pause
exit /b 1
)
echo.
echo [5/5] Creating CUIckScan.zip...
if exist bin\CUIckScan.zip del bin\CUIckScan.zip
powershell -NoProfile -Command "Compress-Archive -Path 'bin\x64\*' -DestinationPath 'bin\CUIckScan.zip' -Force"
if errorlevel 1 (
echo WARNING: Failed to create ZIP — build output is still in bin\x64\
) else (
echo Created bin\CUIckScan.zip
)
echo.
echo ============================================
echo Build complete!
echo Output: bin\x64\
echo ZIP: bin\CUIckScan.zip
echo Run with: bin\x64\CUIckScan.exe
echo Debug: bin\x64\CUIckScan.exe --debug
echo ============================================
pause