Fixes to lua:run

pull/1212/head
Zef Hemel 2025-01-16 15:31:52 +01:00
parent 94acad1a9b
commit 396c9fc60a
1 changed files with 2 additions and 3 deletions

View File

@ -64,12 +64,11 @@ export async function luaRunCommand(
true, true,
configContainer, configContainer,
); );
await serverSystem.init(false); await serverSystem.init(false, false);
console.log("Ok ready");
// Then evaluate it // Then evaluate it
const luaFile = await Deno.readTextFile(scriptPath); const luaFile = await Deno.readTextFile(scriptPath);
const chunk = parse(luaFile, {}); const chunk = parse(luaFile, {});
const env = new LuaEnv(luaBuildStandardEnv()); const env = serverSystem.spaceLuaEnv.env;
const sf = new LuaStackFrame(new LuaEnv(), chunk.ctx); const sf = new LuaStackFrame(new LuaEnv(), chunk.ctx);
sf.threadLocal.setLocal("_GLOBAL", env); sf.threadLocal.setLocal("_GLOBAL", env);