Skip to content

Commit

Permalink
better script to build keypirinha-package
Browse files Browse the repository at this point in the history
  • Loading branch information
ueffel committed Nov 26, 2017
1 parent 13dab84 commit ea054a2
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions build_package.cmd
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
@echo off
SET SEVENZIP=
set PACKAGE_NAME=Kill

set SEVENZIP=
where 7z > nul 2>&1
if not errorlevel 1 (
set SEVENZIP=7z
goto pack
goto done_sevenzip
)

where 7za > nul 2>&1
if not errorlevel 1 (
set SEVENZIP=7za
goto pack
goto done_sevenzip
)

if exist "c:\Program Files (x86)\7-Zip\7z.exe" (
SET "SEVENZIP=c:\Program Files (x86)\7-Zip\7z.exe"
goto pack
set "SEVENZIP=c:\Program Files (x86)\7-Zip\7z.exe"
goto done_sevenzip
)

if exist "c:\Program Files (x86)\7-Zip\7za.exe" (
SET "SEVENZIP=c:\Program Files (x86)\7-Zip\7za.exe"
goto pack
set "SEVENZIP=c:\Program Files (x86)\7-Zip\7za.exe"
goto done_sevenzip
)

if exist "c:\Program Files\7-Zip\7z.exe" (
SET "SEVENZIP=c:\Program Files\7-Zip\7z.exe"
goto pack
set "SEVENZIP=c:\Program Files\7-Zip\7z.exe"
goto done_sevenzip
)

if exist "c:\Program Files\7-Zip\7za.exe" (
SET "SEVENZIP=c:\Program Files\7-Zip\7za.exe"
goto pack
set "SEVENZIP=c:\Program Files\7-Zip\7za.exe"
goto done_sevenzip
)

if NOT DEFINED SEVENZIP (
echo 7zip not found
exit /b 1
)
:done_sevenzip

:pack
if exist Kill.keypirinha-package (
del Kill.keypirinha-package
if exist %PACKAGE_NAME%.keypirinha-package (
del %PACKAGE_NAME%.keypirinha-package
)
echo Using "%SEVENZIP%" to pack
"%SEVENZIP%" a -mx9 -tzip Kill.keypirinha-package -x!%~nx0 -xr!.git *
"%SEVENZIP%" a -mx9 -tzip %PACKAGE_NAME%.keypirinha-package -x!%~nx0 -xr!.git *

0 comments on commit ea054a2

Please sign in to comment.