-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildChoco.cmd
58 lines (48 loc) · 1.23 KB
/
BuildChoco.cmd
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
@echo off
rem ************************************************************
rem
rem Build a Chocolatey package.
rem
rem ************************************************************
setlocal enabledelayedexpansion
:handle_help_request
if /i "%~1" == "-?" call :usage & exit /b 0
if /i "%~1" == "--help" call :usage & exit /b 0
:build
set workingFolder=%~dp0Chocolatey
pushd "%workingFolder%" 2>nul
if !errorlevel! neq 0 (
echo ERROR: "%workingFolder%" folder missing
exit /b 1
)
set nuspecFile=Ansvaultcmd.nuspec
if not exist "%nuspecFile%" (
echo ERROR: "%nuspecFile%" missing
popd & exit /b 1
)
if not exist "bin" (
mkdir "bin"
if !errorlevel! neq 0 popd & exit /b 1
)
for /f %%f in (PkgList.txt) do (
if not exist "%%f" (
echo ERROR: Package artefact "%%f" not found
popd & exit /b 1
)
echo Copying artefact "%%f"
copy /y "%%f" "bin\." 1>nul
)
set packageFolder=..\Packages
if not exist "%packageFolder%" mkdir "%packageFolder%"
if errorlevel 1 exit /b 1
choco pack --out "%packageFolder%"
if %errorlevel% neq 0 popd & exit /b 1
:success
exit /b 0
rem ************************************************************
rem Functions
rem ************************************************************
:usage
echo.
echo Usage: %~n0
goto :eof