aboutsummaryrefslogtreecommitdiff
path: root/src/lua_state.c
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-10-22 15:00:26 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-10-22 15:00:26 +0000
commit5bea8b95e3857b250e98327140a580ef68a59d9c (patch)
tree710026fb87bfd94d87cb16fa650b06e85ac401d6 /src/lua_state.c
parent865342c3fabb50672e2188ccd4d7c3eb7bfb045a (diff)
added some bldit stuff, it's still broken though
Diffstat (limited to 'src/lua_state.c')
-rw-r--r--src/lua_state.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/lua_state.c b/src/lua_state.c
index 297a218..cf46760 100644
--- a/src/lua_state.c
+++ b/src/lua_state.c
@@ -62,6 +62,8 @@ bool init_lua_state(void) {
}
str_free(&lua_path);
+ lua_setglobal(L, "__pkgit_user_config");
+ lua_pop(L, 1);
L_is_loaded = true;
return true;
}
@@ -94,10 +96,8 @@ static void setup_base_dirs(void) {
}
static bool load_init_lua(void) {
- lua_setglobal(L, "__PkgitUserConfig");
- lua_getglobal(L, "__PkgitUserConfig");
-
- lua_get_field_type("dirs", table, &config.init_path, 1);
+ lua_getglobal(L, "__pkgit_user_config");
+ lua_get_field_type("dirs", table, &config.init_path, 2);
#define X(field) \
do { \
@@ -114,20 +114,15 @@ static bool load_init_lua(void) {
#undef X
- lua_pop(L, 1);
+ lua_pop(L, 2);
return true;
}
bool init_lua_config(void) {
setup_base_dirs();
-
- if (!init_lua_state())
- return false;
-
- if (!load_init_lua())
- return false;
-
+ if (!init_lua_state()) return false;
+ if (!load_init_lua()) return false;
return true;
}