-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy-client-build.bat
More file actions
71 lines (61 loc) · 1.55 KB
/
copy-client-build.bat
File metadata and controls
71 lines (61 loc) · 1.55 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
65
66
67
68
69
70
@echo off
echo ========================================
echo Copy client/build to dist/client/build
echo ========================================
echo.
REM Ensure we're in project root
cd /d %~dp0
REM Check if client/build exists
if not exist "client\build" (
echo [ERROR] client\build not found!
echo Please compile the frontend first:
echo cd client
echo npm run build
pause
exit /b 1
)
echo [OK] client\build found!
echo.
REM Ensure dist directory exists
if not exist "dist" (
mkdir "dist"
echo Created dist directory.
)
REM Remove old build if exists
if exist "dist\client\build" (
echo Removing old build folder...
rmdir /S /Q "dist\client\build" >nul 2>&1
)
REM Create destination directory structure
if not exist "dist\client" (
mkdir "dist\client"
echo Created dist\client directory.
)
if not exist "dist\client\build" (
mkdir "dist\client\build"
echo Created dist\client\build directory.
)
REM Copy files
echo Copying files from client\build to dist\client\build...
xcopy /E /I /Y /H "client\build\*" "dist\client\build\"
if %ERRORLEVEL% EQU 0 (
REM Verify index.html was copied
if exist "dist\client\build\index.html" (
echo.
echo [OK] client\build copied successfully to dist\client\build!
echo.
) else (
echo.
echo [ERROR] Files copied but index.html not found!
pause
exit /b 1
)
) else (
echo.
echo [ERROR] Failed to copy files! (Error code: %ERRORLEVEL%)
pause
exit /b 1
)
echo.
echo Done!
pause