iteration

This commit is contained in:
Layla 2023-10-09 07:22:18 -04:00
parent dde9993e07
commit 61c65010e4

View File

@ -38,13 +38,15 @@ function install(package)
io.write("Installing " .. package .. "\n") io.write("Installing " .. package .. "\n")
local dir = bin_path local dir = bin_path
local package_dir = "packages/"
--if package starts with lib then remove lib --if package starts with lib then remove lib
if string.sub(package, 1, 3) == "lib" then if string.sub(package, 1, 3) == "lib" then
package = string.sub(package, 4) package = string.sub(package, 4)
dir = lib_path dir = lib_path
package_dir = "lib/"
end end
download_lua("packages/" .. package .. ".lua", dir .. package .. ".lua") download_lua(package_dir .. package .. ".lua", dir .. package .. ".lua")
if dir == lib_path then if dir == lib_path then
os.loadAPI(lib_path .. package .. ".lua") os.loadAPI(lib_path .. package .. ".lua")
end end