-
Notifications
You must be signed in to change notification settings - Fork 4
/
updatetoworkshop.bat
68 lines (55 loc) · 1.17 KB
/
updatetoworkshop.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
set compressor=gmad.exe
set uploader=gmpublish.exe
set zipper=gma_to_zip.bat
set addonid=246756300
rem Compress
:Compress
cls
echo Addon updating setup.
echo.
set addonpath=%CD%
for %%a in ("%CD%") do set addonpath=%%~dpnxa
for %%a in ("%CD%") do set addonname=%%~nxa
set gmapath=%addonpath%/noupload/%addonname%.gma
echo %compressor% create -folder "%addonpath%" -out "%gmapath%"
%compressor% create -folder "%addonpath%" -out "%gmapath%"
if errorlevel 1 (
echo Coudln't compress the addon!
pause
goto Compress
)
IF exist %zipper% (
echo "%CD%/%zipper%" "%gmapath%"
call "%CD%/%zipper%" "%gmapath%"
@echo off
)
IF "%addonid%"=="" (
goto End
)
pause
:Upload_Question
cls
set /P upload=Upload to Workshop? (Y/N):
if /I %upload%==Y (
goto Upload
)
if /I %upload%==N (
goto End
)
goto Upload_Question
rem Upload
:Upload
cls
set /P changes= < "%addonpath%\changes.txt"
echo %uploader% update -addon "%gmapath%" -id %addonid% -changes "%changes%"
%uploader% update -addon "%gmapath%" -id %addonid% -changes "%changes%"
if errorlevel 1 (
echo Error Uploading "%gmapath%"!
pause
goto Upload
)
pause
:End
@echo on
@exit /B 0