Add --install-dir/-i to pkgm
This commit is contained in:
parent
cba35c2197
commit
cbefe7c514
@ -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.")
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
["version"] = "0.1.1",
|
||||
["version"] = "0.1.2",
|
||||
["dependencies"] = {
|
||||
"mfs",
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user