scripts: update need_string_array() to work as expected

This commit is contained in:
kb-light 2016-08-26 18:53:02 +02:00
parent 21e033213c
commit 4d98fbb1bb
1 changed files with 3 additions and 2 deletions

View File

@ -133,8 +133,9 @@ function need_one_of(varname, array, required)
end
function need_string_array(varname, required)
return assert(pcall(need_array, varname, function(e) assert_type(e, 'string') end, required),
"site.conf error: expected `" .. varname .. "' to be a string array")
local ok, var = pcall(need_array, varname, function(e) assert_type(e, 'string') end, required)
assert(ok, "site.conf error: expected `" .. varname .. "' to be a string array")
return var
end
function need_array_of(varname, array, required)