-
Notifications
You must be signed in to change notification settings - Fork 6
/
archiver.bat
39 lines (26 loc) · 906 Bytes
/
archiver.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
@SETLOCAL
ECHO %~nx0
ECHO Create an archive for a current build.
CALL %env_qUtil%\exit_if_error
SET buildLabel=%1
IF [%buildLabel%] EQU [] EXIT 1001
SET accumPath=%2
IF [%accumPath%] EQU [] EXIT 1002
IF [%accumPath%] EQU [""] EXIT 1002
SET accumPath=%accumPath:"=%
SET q_accumPath="%accumPath%"
SET storePath=%3
IF [%storePath%] EQU [] EXIT 1003
IF [%storePath%] EQU [""] EXIT 1003
SET storePath=%storePath:"=%
SET q_storePath="%storePath%"
SET archType=7z
SET q_archivePath="%accumPath%\..\%buildLabel%.%archType%"
REM Create an archive.
@REM "%ProgramFiles%\WinRar\winrar.exe" a -afzip -r0 %accumPath%.zip *.*
"%ProgramFiles%\7-Zip\7z.exe" a %q_archivePath% "%accumPath%\*"
ECHO ERRORLEVEL %ERRORLEVEL%
IF NOT EXIST %q_storePath% MKDIR %q_storePath%
REM Move archive file to atrifacts
MOVE /Y %q_archivePath% %q_storePath%
ECHO ERRORLEVEL %ERRORLEVEL%