From 7ab55ce0a55f26a2e93abc3ee0f6a0745703160e Mon Sep 17 00:00:00 2001 From: v Date: Sat, 2 Jan 2021 14:58:31 +0000 Subject: [PATCH] add -p option for local package path --- pkgm/bin/pkgm.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgm/bin/pkgm.lua b/pkgm/bin/pkgm.lua index 93b3ec2..aa033a3 100644 --- a/pkgm/bin/pkgm.lua +++ b/pkgm/bin/pkgm.lua @@ -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}