From f1d7a1903e49c75f9965693247e8d102a96b482c Mon Sep 17 00:00:00 2001 From: frosty Date: Wed, 22 Apr 2026 22:30:21 -0400 Subject: misc optimisations and QoL improvements --- src/setup_repo.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/setup_repo.cc') diff --git a/src/setup_repo.cc b/src/setup_repo.cc index 99ca451..bc15d1f 100644 --- a/src/setup_repo.cc +++ b/src/setup_repo.cc @@ -1,10 +1,5 @@ #include -extern "C" { -#include -#include -#include -} - +#include "lua_state.hh" #include "setup_repo.hh" #include "ensure_repo.hh" #include "vars.hh" @@ -12,13 +7,8 @@ extern "C" { void setup_repo() { ensure_repo(); - lua_State *L = lua_open(); - luaL_openlibs(L); - - if (luaL_loadfile(L, config_file.c_str()) || lua_pcall(L, 0, 0, 0)){ - std::cout << print_error << "cannot run configuration script: " << lua_tostring(L, -1) << "\n"; - return; - } + init_lua_state(); + lua_State *L = get_lua_state(); lua_getglobal(L, "repos"); @@ -36,4 +26,4 @@ void setup_repo() { lua_pop(L, 1); } -} +} \ No newline at end of file -- cgit v1.2.3