| 312 | } |
| 313 | |
| 314 | static bool init_run_script(color_ostream &out, lua_State *state, const std::string_view pcmd, const std::span<const std::string> pargs) |
| 315 | { |
| 316 | if (!lua_checkstack(state, pargs.size()+10)) |
| 317 | return false; |
| 318 | Lua::PushDFHack(state); |
| 319 | lua_getfield(state, -1, "run_script"); |
| 320 | lua_remove(state, -2); |
| 321 | lua_pushlstring(state, pcmd.data(), pcmd.size()); |
| 322 | for (const auto& arg : pargs) |
| 323 | lua_pushstring(state, arg.c_str()); |
| 324 | return true; |
| 325 | } |
| 326 | |
| 327 | static command_result runLuaScript(color_ostream &out, const std::string_view name, const std::span<const std::string> args) |
| 328 | { |
no test coverage detected