From 5f7763b0a51db4d95fdf0b019a52c0683c83845e Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Fri, 26 Jun 2015 10:08:41 +0200 Subject: added error message in case of a bad platform value --- src/luarocks/cfg.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 704c7daf..f5d7fb5e 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -257,6 +257,12 @@ do local lst = {} -- use temp array to not confuse `pairs` in loop for plat in pairs(cfg.platforms) do if cfg.platforms[plat] then -- entries set to 'false' skipped + if not platform_order[plat] then + local pl = "" + for k,_ in pairs(platform_order) do pl = pl .. ", " .. k end + io.stderr:write("Bad platform given; "..tostring(plat)..". Valid entries are: "..pl:sub(3,-1) ..".\n") + os.exit(cfg.errorcodes.CONFIGFILE) + end table.insert(lst, plat) else cfg.platforms[plat] = nil -- cgit v1.2.3-55-g6feb