mc-server/MCServer — pull request #1649 by jonfabe (2014-12-05 04:49:16+00:00)
Title: Fix duplicate commands added to README.md

When a `Permissions` section exists in an `Info.lua` file, commands are added twice to the `Permissions` section of the `README.md` file.

What is happening is that in the assignment statement (on line 437): `local Permissions = a_PluginInfo.Permissions or {}`, `a_PluginInfo.Permissions` already exists on the first pass through for the generation of `forum_info.txt` (when a `Permissions` section exists in `Info.lua`). This causes the reference to that table to be assigned to the variable `Permissions` (rather then a brand new blank table - which, in this case, would be unwanted since we would lose the already added permission node descriptions and recommended groups) and thus all the commands are added directly to `a_PluginInfo.Permissions` on the first pass through. Then on the second pass through to generate the `README.md` file, the `Permissions` variable is again assigned the same reference to `a_PluginInfo.Permissions` and the loop re-adds the already added commands to the permission nodes in the table all over again, resulting in duplicated commands in the `Permissions` section of the `README.md` file.

This change will probably slow down `InfoDump.lua` slightly, but it beats de-duping the files after the fact.