-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmk.bat
56 lines (48 loc) · 988 Bytes
/
mk.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
49
50
51
52
53
54
55
56
@echo off
setlocal EnableDelayedExpansion
:conf
call .\scripts\utils\config.bat
set MK_LIST=%*
:chkmklist
if "%MK_LIST%"=="" (
for /R "%PACKS_DIR%" %%a in (*.txt) do (
echo %%~na
call:addToMkList %%~na
)
)
goto mk
:mk
for %%a in (%MK_LIST%) do (
if not exist "%PACKS_DIR%\%%a.txt" (
echo Can not find %PACKS_DIR%\%%a.txt
goto error
)
echo %%a
if exist "%DIST_DIR%\%%a.zip" (
del "%DIST_DIR:/=\%\%%a.zip"
if %ERRORLEVEL% neq 0 goto error
)
for /F "tokens=1,2,3 delims=," %%b in (%PACKS_DIR%\%%a.txt) do (
echo %%b %%c %%d
7za x "%VENDORS_DIR%\%%b\%%c.7z" -o"%TMP_DIR%\%%a\%%d"
if %ERRORLEVEL% neq 0 goto error
)
7za a -tzip "%DIST_DIR%\%%a.zip" "%TMP_DIR%\%%a\*"
if %ERRORLEVEL% neq 0 goto error
)
goto end
:error
echo ERROR
goto end
:: FUNCTIONS
:addToMkList
:: %1 - name of pack
if "%MK_LIST%" equ "" (
set MK_LIST=%1
) else (
set MK_LIST=%MK_LIST% %1
)
goto:eof
:: END OF FUNCTIONS
:end
call .\scripts\utils\end.bat