-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_package.cmd
48 lines (42 loc) · 948 Bytes
/
build_package.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
@echo off
set PACKAGE_NAME=Time
set SEVENZIP=
where 7z > nul 2>&1
if not errorlevel 1 (
set SEVENZIP=7z
goto done_sevenzip
)
where 7za > nul 2>&1
if not errorlevel 1 (
set SEVENZIP=7za
goto done_sevenzip
)
for /f "tokens=3,*" %%v in ('reg query HKCU\Software\7-Zip /v Path') do (
echo %%v %%w
if exist "%%v %%w7z.exe" (
set "SEVENZIP=%%v %%w7z.exe"
goto done_sevenzip
)
if exist "%%v %%w7za.exe" (
set "SEVENZIP=%%v %%w7za.exe"
goto done_sevenzip
)
)
if not defined SEVENZIP (
echo 7zip not found
exit /b 1
)
:done_sevenzip
:pack
if exist %PACKAGE_NAME%.keypirinha-package (
del %PACKAGE_NAME%.keypirinha-package
)
echo Using "%SEVENZIP%" to pack
"%SEVENZIP%" a -mx9 ^
-tzip "%PACKAGE_NAME%.keypirinha-package" ^
-x!%~nx0 ^
-xr!.git ^
-xr!usage.gif ^
-x!.gitignore ^
*