aboutsummaryrefslogtreecommitdiff
path: root/src/setup_repo.cc
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-04-22 22:30:21 -0400
committerdacctal <dacctalyt@gmail.com>2026-04-24 03:39:52 +0000
commitf1d7a1903e49c75f9965693247e8d102a96b482c (patch)
tree1edd5ebe0a62c00353f824581a24e0afa305873f /src/setup_repo.cc
parent0b9cc83f71399a41cf4e93ef82af7c8ba5c2ab96 (diff)
misc optimisations and QoL improvements
Diffstat (limited to 'src/setup_repo.cc')
-rw-r--r--src/setup_repo.cc18
1 files changed, 4 insertions, 14 deletions
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 <iostream>
-extern "C" {
-#include <luajit-2.1/lua.h>
-#include <luajit-2.1/lauxlib.h>
-#include <luajit-2.1/lualib.h>
-}
-
+#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