iteration
This commit is contained in:
parent
7c580e25ea
commit
23839bfcbe
@ -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
18
lum.lua
@ -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
|
Loading…
Reference in New Issue
Block a user