don't list subdirectories named 'internal'

instead of just specifically for lua files with a '-internal.lua' suffix
develop
Myk Taylor 2020-07-24 22:07:16 -07:00
parent da11932d6b
commit 48d4013bcb
2 changed files with 3 additions and 3 deletions

@ -56,7 +56,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Lua ## Lua
- Added a ``ref_target`` field to primitive field references, corresponding to the ``ref-target`` XML attribute - Added a ``ref_target`` field to primitive field references, corresponding to the ``ref-target`` XML attribute
- Support for splitting scripts into multiple files without polluting the output of '#DFHack ls'. Scripts that end in '-internal.lua' will not be listed, but but they can still be 'require'd from other scripts. - Support for splitting scripts into multiple files without polluting the output of ``#DFHack ls``. Scripts can now add internal files to an ``scripts/internal`` folder.
## Ruby ## Ruby
- Updated ``item_find`` and ``building_find`` to use centralized logic that works on more screens - Updated ``item_find`` and ``building_find`` to use centralized logic that works on more screens

@ -301,7 +301,7 @@ static void listScripts(PluginManager *plug_mgr, std::map<string,string> &pset,
path += '/'; path += '/';
for (size_t i = 0; i < files.size(); i++) for (size_t i = 0; i < files.size(); i++)
{ {
if (hasEnding(files[i], ".lua") && !hasEnding(files[i], "-internal.lua")) if (hasEnding(files[i], ".lua"))
{ {
string help = getScriptHelp(path + files[i], "--"); string help = getScriptHelp(path + files[i], "--");
string key = prefix + files[i].substr(0, files[i].size()-4); string key = prefix + files[i].substr(0, files[i].size()-4);
@ -317,7 +317,7 @@ static void listScripts(PluginManager *plug_mgr, std::map<string,string> &pset,
pset[key] = help; pset[key] = help;
} }
} }
else if (all && !files[i].empty() && files[i][0] != '.') else if (all && !files[i].empty() && files[i][0] != '.' && files[i] != "internal")
{ {
listScripts(plug_mgr, pset, path+files[i]+"/", all, prefix+files[i]+"/"); listScripts(plug_mgr, pset, path+files[i]+"/", all, prefix+files[i]+"/");
} }