| 313 | } |
| 314 | |
| 315 | int cliLuaSystem(lua_State* L) { |
| 316 | auto command = cliGetString(L, 1); |
| 317 | fs::path cwd; |
| 318 | bool hasCwd = lua_gettop(L) >= 2 && !lua_isnil(L, 2); |
| 319 | if (hasCwd) cwd = cliGetString(L, 2); |
| 320 | auto oldPath = fs::current_path(); |
| 321 | if (hasCwd) fs::current_path(cwd); |
| 322 | int result = std::system(command.c_str()); |
| 323 | if (hasCwd) fs::current_path(oldPath); |
| 324 | lua_pushinteger(L, result); |
| 325 | return 1; |
| 326 | } |
| 327 | |
| 328 | int cliLuaHttp(lua_State* L) { |
| 329 | auto method = cliGetString(L, 1); |
nothing calls this directly
no test coverage detected