Repository navigation
Expand file tree
/
Copy pathmake.bat
More file actions
68 lines (62 loc) · 1.66 KB
/
Copy pathmake.bat
File metadata and controls
68 lines (62 loc) · 1.66 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
@echo off
IF "%1"=="" GOTO build
IF "%1"=="all" GOTO build
IF "%1"=="build" GOTO build
IF "%1"=="build_cdd_web_ui" GOTO build_cdd_web_ui
IF "%1"=="test" GOTO test
IF "%1"=="lint" GOTO lint
IF "%1"=="typecheck" GOTO typecheck
IF "%1"=="clean" GOTO clean
GOTO :EOF
:build_cdd_web_ui
echo Building ..\cdd-web-ui (production)...
pushd ..\cdd-web-ui
if errorlevel 1 exit /b 1
if not exist "node_modules\@angular\build" (
call npm install
if errorlevel 1 (
popd
exit /b 1
)
)
call npm run build:prod -- --base-href /cdd-web-ui/
if errorlevel 1 (
popd
exit /b 1
)
popd
echo Syncing ..\cdd-web-ui\dist\cdd-web-ui\browser into .\cdd-web-ui...
if exist "cdd-web-ui" rmdir /s /q "cdd-web-ui"
mkdir "cdd-web-ui"
xcopy /E /I /Y "..\cdd-web-ui\dist\cdd-web-ui\browser\*" "cdd-web-ui"
if errorlevel 1 exit /b 1
if exist "cdd-web-ui\assets\wasm" rmdir /s /q "cdd-web-ui\assets\wasm"
copy /Y "cdd-web-ui\index.html" "cdd-web-ui\404.html" >nul
copy /Y "cdd-web-ui\index.html" "404.html" >nul
for %%R in (workspace login auth-callback dashboard dashboard\organizations dashboard\repositories dashboard\secrets dashboard\audit-logs) do (
if not exist "cdd-web-ui\%%R" mkdir "cdd-web-ui\%%R"
copy /Y "cdd-web-ui\index.html" "cdd-web-ui\%%R\index.html" >nul
)
GOTO :EOF
:build
CALL "%~f0" build_cdd_web_ui
if errorlevel 1 exit /b 1
call npm run build
if errorlevel 1 exit /b 1
GOTO :EOF
:test
call npm test
if errorlevel 1 exit /b 1
GOTO :EOF
:lint
call npm run lint
if errorlevel 1 exit /b 1
GOTO :EOF
:typecheck
call npm run typecheck
if errorlevel 1 exit /b 1
GOTO :EOF
:clean
if exist "dist" rmdir /s /q "dist"
if exist "coverage" rmdir /s /q "coverage"
GOTO :EOF