-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpublish_mod.bat
More file actions
31 lines (25 loc) · 773 Bytes
/
publish_mod.bat
File metadata and controls
31 lines (25 loc) · 773 Bytes
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
@echo off
setlocal EnableDelayedExpansion
for /f "tokens=*" %%i in ('findstr \"name\" info.json') do (
set "Line=%%i"
set "Line=!Line:* "=!"
)
set "Modname=!Line:",=!"
for /f "tokens=*" %%i in ('findstr \"version\" info.json') do (
set "Line=%%i"
set "Line=!Line:* "=!"
)
set "Version=!Line:",=!"
echo Preparing to publish %Modname% Version %Version%...
set Moddir=%~dp0
set Moddir=!Moddir:~0,-1!
echo %Moddir%
echo Copying files from %Moddir% to temp\%Modname%...
cd ..
xcopy /S /I /E %Moddir% temp\%Modname% /EXCLUDE:%Moddir%\publish_exclude.txt
cd temp
echo Compressing %Modname%_%Version%.zip...
7z a ..\%Modname%_%Version%.zip %Modname%
echo Cleaning up temporary files...
rd /S /Q %Modname%
echo Finished publishing %Modname% Version %Version%.