forked from linuxgurugamer/FilterExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildRelease.bat
53 lines (33 loc) · 1.22 KB
/
buildRelease.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
@echo off
rem Set variables here
set GAMEDIR=000_FilterExtensions
set GAMEDIR2="000_FilterExtensions_Configs"
set LICENSE=License.txt
set README=ReadMe.txt
set RELEASEDIR=d:\Users\jbb\release
set ZIP="c:\Program Files\7-zip\7z.exe"
rem Copy files to GameData locations
copy /Y "%1%2" "GameData\%GAMEDIR%\Plugins"
copy /Y FilterExtension.version GameData\%GAMEDIR%
if "%LICENSE%" NEQ "" copy /y %LICENSE% GameData\%GAMEDIR%
if "%README%" NEQ "" copy /Y %README% GameData\%GAMEDIR%
rem Get Version info
set VERSIONFILE=FilterExtension.version
rem The following requires the JQ program, available here: https://stedolan.github.io/jq/download/
c:\local\jq-win64 ".VERSION.MAJOR" %VERSIONFILE% >tmpfile
set /P major=<tmpfile
c:\local\jq-win64 ".VERSION.MINOR" %VERSIONFILE% >tmpfile
set /P minor=<tmpfile
c:\local\jq-win64 ".VERSION.PATCH" %VERSIONFILE% >tmpfile
set /P patch=<tmpfile
c:\local\jq-win64 ".VERSION.BUILD" %VERSIONFILE% >tmpfile
set /P build=<tmpfile
del tmpfile
set VERSION=%major%.%minor%.%patch%
if "%build%" NEQ "0" set VERSION=%VERSION%.%build%
echo Version: %VERSION%
rem Build the zip FILE
set FILE="%RELEASEDIR%\%GAMEDIR%-%VERSION%.zip"
IF EXIST %FILE% del /F %FILE%
%ZIP% a -tzip %FILE% GameData
pause