added package manager, probably useful for something, not sure what

This commit is contained in:
v
2020-12-28 16:01:41 +00:00
parent 1bebaa0f40
commit d46df8884b
3 changed files with 140 additions and 0 deletions

26
pkgm/bin/pkgm.lua Normal file
View File

@@ -0,0 +1,26 @@
local args={...}
local pkg=dofile("/lib/pkgm.lua")
if args[1]=="i" and args[2]~=nil then
local deps=pkg.dependencies(args[2])
if not deps then
print("Already up to date, æpioform.")
return
end
print("To be installed or updated:\n")
print(table.concat(deps," "))
print("\nPress the any key to continue.")
os.pullEvent("char")
pkg.pkginstmulti(deps)
print("Done!")
elseif args[1]=="rm" and args[2]~=nil then
table.remove(args,1)
print("If this breaks things, you're completely responsible.")
print("Press the any key to continue.")
os.pullEvent("char")
for i,v in ipairs(args) do
pkg.pkguinst(v)
end
print("Done.")
else
print("usage:\ni <package>\nupd <package>\nrm <packages>")
end