| 418 | } |
| 419 | |
| 420 | bool cScriptingEngine::scriptsLoadFolder(const std::string& pFolder) { |
| 421 | |
| 422 | auto finalpath = g_ResourceMan->GetScriptPath(pFolder); |
| 423 | auto scripts = g_ResourceMan->DirectoryList(finalpath, "js"); |
| 424 | |
| 425 | for (auto scriptFile : scripts) { |
| 426 | |
| 427 | auto finalName = pFolder + scriptFile; |
| 428 | auto script = g_ResourceMan->FileReadStr(finalpath + scriptFile); |
| 429 | |
| 430 | if (!script.size() || (scriptRun(script, finalName) == false)) { |
| 431 | g_Debugger->Error(finalpath + scriptFile + " Failed to execute script:" + scriptFile); |
| 432 | return false; |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | return true; |
| 437 | } |
| 438 | |
| 439 | bool cScriptingEngine::scriptRun(const std::string& pJS, const std::string& pFilename) { |
| 440 | int success = DUK_EXEC_ERROR; |
nothing calls this directly
no test coverage detected