lordgamez commented on a change in pull request #1237:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1237#discussion_r783212100



##########
File path: extensions/script/lua/LuaScriptEngine.cpp
##########
@@ -65,15 +65,32 @@ LuaScriptEngine::LuaScriptEngine()
 
 void LuaScriptEngine::eval(const std::string &script) {
   try {
-    lua_.script(script, sol::script_throw_on_error);
+    if (!module_directories_.empty()) {
+      auto appended_script = script;
+      for (const auto& module_dir : module_directories_) {
+        appended_script = "package.path = package.path .. \";" + module_dir + 
"/?.lua\"\n" + script;
+      }
+      lua_.script(appended_script, sol::script_throw_on_error);

Review comment:
       Updated in c5bc09b98061f1d2295e38e4b1d63795c3eafdfd




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to