From 22913f3a1d9a841930839914f04e4841fc77fcdf Mon Sep 17 00:00:00 2001 From: v Date: Tue, 29 Dec 2020 11:05:02 +0000 Subject: [PATCH] Make the -i option work properly with --- pkgm/bin/pkgm.lua | 9 +++++---- pkgm/pkgmeta.ltn | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgm/bin/pkgm.lua b/pkgm/bin/pkgm.lua index 48c9c8d..72c4357 100644 --- a/pkgm/bin/pkgm.lua +++ b/pkgm/bin/pkgm.lua @@ -8,17 +8,18 @@ while ptr>0 do if args[ptr+1] then flags.install_dir=args[ptr+1] table.remove(args,ptr+1) + table.remove(args,ptr) else error("--install-dir needs an argument") end end ptr=ptr-1 end +if flags.install_dir then + local s,r=pkg.set_install_dir(flags.install_dir) + if not s then error(r) end +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.") diff --git a/pkgm/pkgmeta.ltn b/pkgm/pkgmeta.ltn index 737226c..178f3e0 100644 --- a/pkgm/pkgmeta.ltn +++ b/pkgm/pkgmeta.ltn @@ -1,5 +1,5 @@ { - ["version"] = "0.1.2", + ["version"] = "0.1.2-1", ["dependencies"] = { "mfs", },