Add --install-dir/-i to pkgm

This commit is contained in:
v 2020-12-29 10:30:50 +00:00
parent cba35c2197
commit cbefe7c514
2 changed files with 19 additions and 1 deletions

View File

@ -1,6 +1,24 @@
local args={...}
local pkg=dofile("/lib/pkgm.lua")
local flags={}
local ptr=#args
while ptr>0 do
local c=args[ptr]
if c=="-i" or c=="--install-dir" then
if args[ptr+1] then
flags.install_dir=args[ptr+1]
table.remove(args,ptr+1)
else
error("--install-dir needs an argument")
end
end
ptr=ptr-1
end
if args[1]=="i" and args[2]~=nil then
if flags.install_dir then
local s,r=pkg.set_install_dir(flags.install_dir)
if not s then error(r) end
end
local deps=pkg.dependencies(args[2])
if not deps then
print("Already up to date, æpioform.")

View File

@ -1,5 +1,5 @@
{
["version"] = "0.1.1",
["version"] = "0.1.2",
["dependencies"] = {
"mfs",
},