From 9efe3b443e6f84f75ecfb6d5193ae1ff1eb3d485 Mon Sep 17 00:00:00 2001 From: dacctal Date: Sat, 18 Jul 2026 02:41:45 +0000 Subject: declare your packages!!! --- src/pkg_install.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/pkg_install.c') diff --git a/src/pkg_install.c b/src/pkg_install.c index b911a71..6ee7e08 100644 --- a/src/pkg_install.c +++ b/src/pkg_install.c @@ -32,28 +32,28 @@ #include "pkg.h" void install_dependencies(lua_State *L) { - while (lua_next(L, -2) != 0) { - const char *depname = lua_tostring(L, -2); - if (depname && lua_istable(L, -1)) { - lua_getfield(L, -1, "url"); - str dep_url = mstr(lua_tostring(L, -1)); - lua_pop(L, 1); - package_t pkg = pkg_create(&dep_url); - str_free(&dep_url); - lua_getfield(L, -1, "version"); - pkg.version = mstr(lua_tostring(L, -1)); - lua_pop(L, 1); - const int top = lua_gettop(L); - char cwd[MAX_PATH_LEN]; - if (getcwd(cwd, sizeof(cwd)) != NULL) { - pkg_install(&pkg); - chdir(cwd); - } - lua_settop(L, top); - pkg_free(&pkg); - } - lua_pop(L, 1); - } + while (lua_next(L, -2) != 0) { + const char *depname = lua_tostring(L, -2); + if (depname && lua_istable(L, -1)) { + lua_getfield(L, -1, "url"); + str dep_url = mstr(lua_tostring(L, -1)); + lua_pop(L, 1); + package_t pkg = pkg_create(&dep_url); + str_free(&dep_url); + lua_getfield(L, -1, "version"); + pkg.version = mstr(lua_tostring(L, -1)); + lua_pop(L, 1); + const int top = lua_gettop(L); + char cwd[MAX_PATH_LEN]; + if (getcwd(cwd, sizeof(cwd)) != NULL) { + pkg_install(&pkg); + chdir(cwd); + } + lua_settop(L, top); + pkg_free(&pkg); + } + lua_pop(L, 1); + } } bool target_install(lua_State *L, char* lua_file, str *target) { -- cgit v1.2.3