-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bat
59 lines (49 loc) · 1021 Bytes
/
setup.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
57
58
59
@echo off
:Main
setlocal
where scoop > nul 2> nul
if %ERRORLEVEL% == 1 (
call :LogError "You must install scoop. https://github.com/lukesampson/scoop"
exit /b
)
call :InstallPackage "git-with-openssh"
call :InstallPackage "aria2"
exit /b
endlocal
:InstallPackage
setlocal
set PACKAGE_NAME=%~1
scoop list | find " %PACKAGE_NAME% " > nul
if %ERRORLEVEL% == 0 (
call :LogDebug "Already installed" %PACKAGE_NAME%
) else (
call :LogInfo "Install" %PACKAGE_NAME%
call scoop install %PACKAGE_NAME%
)
exit /b
endlocal
:LogDebug
setlocal
call :LogImpl D %*
exit /b
endlocal
:LogInfo
setlocal
call :LogImpl I %*
exit /b
endlocal
:LogError
setlocal
call :LogImpl E %*
exit /b
endlocal
:LogImpl
setlocal
set /p NOP=%date% < nul
set /p NOP=%time% < nul
for %%s in (%*) do (
set /p NOP=%%~s < nul
)
echo;
exit /b
endlocal