summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-09 15:56:24 +0200
committermadmaxoft <github@xoft.cz>2013-10-09 15:56:24 +0200
commit9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8 (patch)
tree0d91386dc3e2d80588bb6fef9695fd27de5aefc6
parentAPIDump: Implemented basic hook documentation. (diff)
downloadcuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar.gz
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar.bz2
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar.lz
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar.xz
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.tar.zst
cuberite-9deb9cfa0e3c79ed1ff1fbc702d84a61cba0f6d8.zip
-rw-r--r--MCServer/Plugins/APIDump/main.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua
index 6d4ac3d04..bb8de1d1b 100644
--- a/MCServer/Plugins/APIDump/main.lua
+++ b/MCServer/Plugins/APIDump/main.lua
@@ -250,7 +250,13 @@ function DumpAPIHtml()
<p>The following pages provide various extra information</p>
<ul>]]);
for i, extra in ipairs(g_APIDesc.ExtraPages) do
- if (cFile:Copy(g_PluginFolder .. "/" .. extra.FileName, "API/" .. extra.FileName)) then
+ local SrcFileName = g_PluginFolder .. "/" .. extra.FileName;
+ if (cFile:Exists(SrcFileName)) then
+ local DstFileName = "API/" .. extra.FileName;
+ if (cFile:Exists(DstFileName)) then
+ cFile:Delete(DstFileName);
+ end
+ cFile:Copy(SrcFileName, DstFileName);
f:write("<li><a href=\"" .. extra.FileName .. "\">" .. extra.Title .. "</a></li>\n");
else
f:write("<li>" .. extra.Title .. " <i>(file is missing)</i></li>\n");