-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdl.bat
46 lines (41 loc) · 1.11 KB
/
dl.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
@echo off
:config
call .\scripts\utils\config.bat
set DL_LIST=%*
:chkdllist
if "%DL_LIST%"=="" set DL_LIST=node npm 7z unxutils git nginx
:dl
for %%a in (%DL_LIST%) do (
echo.
if exist "%VERSIONS_DIR%\%%a.txt" (
echo %%a
if not exist "%VENDORS_DIR%\%%a" (
mkdir "%VENDORS_DIR%\%%a"
if %ERRORLEVEL% neq 0 goto error
)
for /f "tokens=1,2 delims=," %%b in ('type %VERSIONS_DIR%\%%a.txt') do (
echo %%b %%c
if exist "%VENDORS_DIR%\%%a\%%b.7z" (
echo Already exists: %VENDORS_DIR%\%%a\%%b.7z
) else (
if not exist "%VENDORS_DIR%\%%a\%%b" (
mkdir "%VENDORS_DIR%\%%a\%%b"
if %ERRORLEVEL% neq 0 goto error
)
call scripts\dl\%%a.bat %%c %VENDORS_DIR%\%%a\%%b
if %ERRORLEVEL% neq 0 goto error
7za a -t7z "%VENDORS_DIR%\%%a\%%b.7z" "%VENDORS_DIR%\%%a\%%b\*"
if %ERRORLEVEL% neq 0 goto error
rmdir /S /Q "%VENDORS_DIR%\%%a\%%b"
if %ERRORLEVEL% neq 0 goto error
)
)
) else (
echo File not found: %VERSIONS_DIR%\%%a.txt
)
)
goto end
:error
echo ERROR
:end
call .\scripts\utils\end.bat