-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.bat
34 lines (25 loc) · 860 Bytes
/
bundle.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
@echo off
cls
set ASSETS_FOLDER_NAME=\assets
set INDEX_FILENAME=index.html
set TARGET_BASE_DIR=.\.build
set TARGET_ASSETS_DIR=%TARGET_BASE_DIR%%ASSETS_FOLDER_NAME%
set SOURCE_BASE_DIR=.
set SOURCE_ASSETS_DIR=%SOURCE_BASE_DIR%%ASSETS_FOLDER_NAME%
if exist %TARGET_ASSETS_DIR% (
echo removing target assets directory "%TARGET_ASSETS_DIR%"...
rd /s /q "%TARGET_ASSETS_DIR%"
)
echo copying assets folder %SOURCE_ASSETS_DIR% to %TARGET_ASSETS_DIR%...
xcopy /e /i /y /exclude:bundleExcludedFilesList.txt "%SOURCE_ASSETS_DIR%" "%TARGET_ASSETS_DIR%"
if %ERRORLEVEL% neq 0 goto ErrorHappened
echo copying index file "%INDEX_FILENAME%"...
copy /y "%SOURCE_BASE_DIR%\%INDEX_FILENAME%" "%TARGET_BASE_DIR%\%INDEX_FILENAME%"
if %ERRORLEVEL% neq 0 goto ErrorHappened
call npm run pro
echo Boom. Done.
pause
goto:eof
:ErrorHappened
echo An error occurred...
pause