diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-06-26 10:08:41 +0200 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2015-06-26 10:08:41 +0200 |
| commit | 5f7763b0a51db4d95fdf0b019a52c0683c83845e (patch) | |
| tree | 68434c7f5f64bff96db0d21b1b49f46a7cf58c02 /src | |
| parent | 253ed468542853878cd01166ec3b08e624499409 (diff) | |
| download | luarocks-5f7763b0a51db4d95fdf0b019a52c0683c83845e.tar.gz luarocks-5f7763b0a51db4d95fdf0b019a52c0683c83845e.tar.bz2 luarocks-5f7763b0a51db4d95fdf0b019a52c0683c83845e.zip | |
added error message in case of a bad platform value
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/cfg.lua | 6 |
1 files changed, 6 insertions, 0 deletions
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 | |||
| 257 | local lst = {} -- use temp array to not confuse `pairs` in loop | 257 | local lst = {} -- use temp array to not confuse `pairs` in loop |
| 258 | for plat in pairs(cfg.platforms) do | 258 | for plat in pairs(cfg.platforms) do |
| 259 | if cfg.platforms[plat] then -- entries set to 'false' skipped | 259 | if cfg.platforms[plat] then -- entries set to 'false' skipped |
| 260 | if not platform_order[plat] then | ||
| 261 | local pl = "" | ||
| 262 | for k,_ in pairs(platform_order) do pl = pl .. ", " .. k end | ||
| 263 | io.stderr:write("Bad platform given; "..tostring(plat)..". Valid entries are: "..pl:sub(3,-1) ..".\n") | ||
| 264 | os.exit(cfg.errorcodes.CONFIGFILE) | ||
| 265 | end | ||
| 260 | table.insert(lst, plat) | 266 | table.insert(lst, plat) |
| 261 | else | 267 | else |
| 262 | cfg.platforms[plat] = nil | 268 | cfg.platforms[plat] = nil |
