From 71006f5df54e58ef30f6471becf97a654afbccbf Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 20 Dec 2013 16:03:26 +0000 Subject: [PATCH 1/5] Create a static folder for adding static files. .gitignore is basically just an empty file that might serve a purpose someday. --- MCServer/Plugins/APIDump/Static/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 MCServer/Plugins/APIDump/Static/.gitignore diff --git a/MCServer/Plugins/APIDump/Static/.gitignore b/MCServer/Plugins/APIDump/Static/.gitignore new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/MCServer/Plugins/APIDump/Static/.gitignore @@ -0,0 +1 @@ + From 675c35708b0c4657a98341d78ba7d9f06323d35d Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 20 Dec 2013 16:14:49 +0000 Subject: [PATCH 2/5] Possibly fixes #384 @madmaxoft, is this the right syntax for lua for loops? --- MCServer/Plugins/APIDump/main_APIDump.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua index ec5569f55..676f4d9a6 100644 --- a/MCServer/Plugins/APIDump/main_APIDump.lua +++ b/MCServer/Plugins/APIDump/main_APIDump.lua @@ -231,6 +231,12 @@ end function DumpAPIHtml() + LOG("Moving static files."); + + for i in cFile:GetFolderContents("Static") do + cFile:Copy("Static/" .. i, "API/" .. i); + end + LOG("Dumping all available functions and constants to API subfolder..."); LOG("Creating API tables..."); From 837bbf0de369a560ed0701e3f63e002a7171a8f8 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 20 Dec 2013 16:31:30 +0000 Subject: [PATCH 3/5] @madmaxoft now? --- MCServer/Plugins/APIDump/main_APIDump.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua index 676f4d9a6..d7aff1926 100644 --- a/MCServer/Plugins/APIDump/main_APIDump.lua +++ b/MCServer/Plugins/APIDump/main_APIDump.lua @@ -1,4 +1,3 @@ - -- main.lua -- Implements the plugin entrypoint (in this case the entire plugin) @@ -233,8 +232,9 @@ end function DumpAPIHtml() LOG("Moving static files."); - for i in cFile:GetFolderContents("Static") do - cFile:Copy("Static/" .. i, "API/" .. i); + local localFolder = g_Plugin:GetLocalFolder(); + for k, v in cFile:GetFolderContents("Static") do + cFile:Copy(localFolder .. "/Static/" .. v, localFolder .. "/API/" .. v); end LOG("Dumping all available functions and constants to API subfolder..."); From d31fd1528b909e40022e4fbe27fe98d74b30e34e Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 20 Dec 2013 16:38:10 +0000 Subject: [PATCH 4/5] fix the issues xoft pointed out --- MCServer/Plugins/APIDump/main_APIDump.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua index d7aff1926..7df1367d1 100644 --- a/MCServer/Plugins/APIDump/main_APIDump.lua +++ b/MCServer/Plugins/APIDump/main_APIDump.lua @@ -230,14 +230,13 @@ end function DumpAPIHtml() - LOG("Moving static files."); - - local localFolder = g_Plugin:GetLocalFolder(); - for k, v in cFile:GetFolderContents("Static") do - cFile:Copy(localFolder .. "/Static/" .. v, localFolder .. "/API/" .. v); - end - LOG("Dumping all available functions and constants to API subfolder..."); + + LOG("Moving static files.."); + local localFolder = ipairs(g_Plugin:GetLocalFolder()); + for k, v in cFile:GetFolderContents("Static") do + cFile:Copy(localFolder .. "/Static/" .. v, "API/" .. v); + end LOG("Creating API tables..."); local API, Globals = CreateAPITables(); From ba5e42de4084e92315de0b7522a5b913064f806d Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 20 Dec 2013 17:12:39 +0000 Subject: [PATCH 5/5] done... finally --- MCServer/Plugins/APIDump/main_APIDump.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MCServer/Plugins/APIDump/main_APIDump.lua b/MCServer/Plugins/APIDump/main_APIDump.lua index 7df1367d1..404e0a519 100644 --- a/MCServer/Plugins/APIDump/main_APIDump.lua +++ b/MCServer/Plugins/APIDump/main_APIDump.lua @@ -233,8 +233,8 @@ function DumpAPIHtml() LOG("Dumping all available functions and constants to API subfolder..."); LOG("Moving static files.."); - local localFolder = ipairs(g_Plugin:GetLocalFolder()); - for k, v in cFile:GetFolderContents("Static") do + local localFolder = g_Plugin:GetLocalFolder(); + for k, v in cFile:GetFolderContents(localFolder .. "/Static") do cFile:Copy(localFolder .. "/Static/" .. v, "API/" .. v); end