MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / cliLuaSystem

Function cliLuaSystem

Source/Basic/Application.cpp:315–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315int 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
328int cliLuaHttp(lua_State* L) {
329 auto method = cliGetString(L, 1);

Callers

nothing calls this directly

Calls 5

cliGetStringFunction · 0.85
current_pathFunction · 0.85
lua_gettopFunction · 0.50
lua_pushintegerFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected