aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-12-13 04:53:45 -0800
committerHisham Muhammad <hisham@gobolinux.org>2013-12-13 04:53:45 -0800
commit5ca108f27d4a4a6dce188a3c22ba0584ece1666c (patch)
tree502c13d71747ccb11d66632522a524c6365ad53a
parent949c05e7b71f061f014aa61d54e7d47998955ad1 (diff)
parentca0cf6232d3cf672ca9abf06f0c64c5584baac9d (diff)
downloadluarocks-5ca108f27d4a4a6dce188a3c22ba0584ece1666c.tar.gz
luarocks-5ca108f27d4a4a6dce188a3c22ba0584ece1666c.tar.bz2
luarocks-5ca108f27d4a4a6dce188a3c22ba0584ece1666c.zip
Merge pull request #200 from fab13n/master
Fixed an improper error message
Diffstat (limited to '')
-rw-r--r--src/luarocks/type_check.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua
index 5436bde6..a3d41efc 100644
--- a/src/luarocks/type_check.lua
+++ b/src/luarocks/type_check.lua
@@ -1,4 +1,3 @@
1
2--- Type-checking functions. 1--- Type-checking functions.
3-- Functions and definitions for doing a basic lint check on files 2-- Functions and definitions for doing a basic lint check on files
4-- loaded by LuaRocks. 3-- loaded by LuaRocks.
@@ -183,7 +182,9 @@ local function type_check_item(name, item, expected, context)
183 return nil, "Type mismatch on field "..context..name..": expected a string" 182 return nil, "Type mismatch on field "..context..name..": expected a string"
184 end 183 end
185 if expected ~= "string" then 184 if expected ~= "string" then
186 if not item:match("^"..expected.."$") then 185 if item_type ~= "string" then
186 return nil, "Type mismatch on field "..context..name..": expected a string, got a "..type(item)
187 elseif not item:match("^"..expected.."$") then
187 return nil, "Type mismatch on field "..context..name..": invalid value "..item.." does not match '"..expected.."'" 188 return nil, "Type mismatch on field "..context..name..": invalid value "..item.." does not match '"..expected.."'"
188 end 189 end
189 end 190 end