summaryrefslogtreecommitdiffstats
path: root/MakeLuaAPI.cmd
blob: 90b8cf53e461ee341f2d9c8d5638d11d3c1915bd (plain) (blame)
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
@echo off
:: MakeLuaAPI.cmd
:: This script is run after the nightbuild to produce the Lua API documentation and upload it to a website.
:: It expects at least three environment variables set: ftpsite, ftpuser and ftppass, specifying the FTP site and login to use for the upload





:: Check that we got all the environment vars needed for the upload:

if "a%ftppass%" == "a" (
	echo You need to set FTP password in the ftppass environment variable to upload the files
	goto end
)
if "a%ftpuser%" == "a" (
	echo You need to set FTP username in the ftpuser environment variable to upload the files
	goto end
)
if "a%ftpsite%" == "a" (
	echo You need to set FTP server in the ftpsite environment variable to upload the files
	goto end
)





:: Create the API documentation by running the server and stopping it right after it starts:

cd MCServer
copy /Y settings_apidump.ini settings.ini
echo api | MCServer
cd ..





:: Upload the API to the web:

ncftpput -p %ftppass% -u %ftpuser% -T temp_ -R %ftpsite% /LuaAPI MCServer/API/*.*
if errorlevel 1 goto haderror
echo Upload finished.

goto end





:haderror
echo an error was encountered, check command output above
pause
goto finished





:end
if "a%1" == "a" pause



:finished
hhhhhh