scripts: feature_lib.lua: improve error handling for invalid feature files
Print a proper error message, rather than just openwrt/staging_dir/hostpkg/bin/lua: scripts/feature_lib.lua:48: bad argument #1 to 'setfenv' (integer expected, got nil)
This commit is contained in:
parent
b1294472c6
commit
097efa9d2d
@ -43,7 +43,10 @@ function M.get_packages(file, features)
|
||||
end
|
||||
|
||||
-- Evaluate the feature definition file
|
||||
local f = loadfile(file)
|
||||
local f, err = loadfile(file)
|
||||
if not f then
|
||||
error('Failed to parse feature definition: ' .. err)
|
||||
end
|
||||
setfenv(f, funcs)
|
||||
f()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user