add -p option for local package path

This commit is contained in:
v 2021-01-02 14:58:31 +00:00
parent 58b39788f3
commit 7ab55ce0a5
1 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,14 @@ while ptr>0 do
else
error("--install-dir needs an argument")
end
elseif c=="-p" or c=="--package-dir" then
if args[ptr+1] then
flags.package_dir=args[ptr+1]
table.remove(args,ptr+1)
table.remove(args,ptr)
else
error("--package-dir needs an argument")
end
end
ptr=ptr-1
end
@ -19,6 +27,10 @@ if flags.install_dir then
local s,r=pkg.set_install_dir(flags.install_dir)
if not s then error(r) end
end
if flags.package_dir then
pkg.set_local(true)
pkg.set_pkg_url(flags.package_dir)
end
if args[1]=="i" and args[2]~=nil then
local deps=pkg.dependencies(args[2])
local rstrt={false}