scripts/check_site.lua: use new format() function to simplify var_error()

This commit is contained in:
Matthias Schiffer 2019-04-28 19:17:47 +02:00
parent 5abddd2976
commit 16a78b4e9e
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -119,13 +119,9 @@ local function conf_src(path)
end
local function var_error(path, val, msg)
if type(val) == 'string' then
val = string.format('%q', val)
end
local found = 'unset'
if val ~= nil then
found = string.format('%s (a %s value)', tostring(val), type(val))
found = string.format('%s (a %s value)', format(val), type(val))
end
config_error(conf_src(path), 'expected %s to %s, but it is %s', path_to_string(path), msg, found)