iteration

This commit is contained in:
Layla 2023-10-08 04:14:52 -04:00
parent 7c580e25ea
commit 23839bfcbe
2 changed files with 18 additions and 5 deletions

View File

@ -34,4 +34,9 @@ end
function install(package)
io.write("Installing " .. package .. "\n")
download_lua("packages/" .. package .. ".lua", bin_path .. package .. ".lua")
end
function remove(package)
io.write("Removing " .. package .. "\n")
fs.delete(bin_path .. package .. ".lua")
end

18
lum.lua
View File

@ -1,11 +1,6 @@
local args = { ... }
local action = args[1]
if action == nil then
print("Usage: lum <install:remove>")
return
end
if action == "install" then
package = args[2]
@ -16,4 +11,17 @@ if action == "install" then
lum.install(package)
io.write("Done!\n")
elseif action == "remove" then
package = args[2]
if package == nil then
print("Usage: lum remove <package>")
return
end
lum.remove(package)
io.write("Done!\n")
elseif action == "version" then
print("Lum version 0.1.0")
else
io.write("Usage: lum <install:remove:version>\n")
end