-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvars.bat
48 lines (41 loc) · 997 Bytes
/
vars.bat
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
SET CFLAGS=!CFLAGS! /I../
SET CSWEB_BUILD_FRONTEND=0
FOR %%a IN (%PLUGIN_ARGS%) DO (
IF "%%a"=="wbuild" SET CSWEB_BUILD_FRONTEND=1
)
IF EXIST "..\cs-base\src\base_itf.h" (
SET CFLAGS=!CFLAGS! /DCSWEB_USE_BASE
ECHO Base interface connected
)
IF EXIST "..\cs-lua\src\luaitf.h" (
SET CSSCRIPTS_ONLY_INCLUDES=1
CALL ..\cs-lua\vars.bat
IF "!ERRORLEVEL!"=="0" (
SET CFLAGS=!CFLAGS! /DCSWEB_USE_LUA
ECHO Lua interface connected
) else (
ECHO Failed to bind the Lua interface
)
)
IF "%CSWEB_BUILD_FRONTEND%"=="1" (
WHERE npm >nul 2>nul
IF NOT "!ERRORLEVEL!"=="0" (
ECHO NodeJS is not installed!
EXIT /B 1
)
PUSHD !ROOT!\websource
CALL npm install && CALL npm run build
IF NOT "!ERRORLEVEL!"=="0" (
POPD
ECHO Failed to build webdata
EXIT /B 1
)
POPD
IF "!PLUGIN_INSTALL!"=="1" (
SET PLUGIN_INSTALL_PATH=%SERVER_OUTROOT%\webdata\
) ELSE (
SET PLUGIN_INSTALL_PATH=%OUTDIR%\webdata\
)
XCOPY /E /S /Y "!ROOT!\websource\build\" "!PLUGIN_INSTALL_PATH!"
)
EXIT /B 0