Skip to content

Commit

Permalink
fixup! build: implement flexible site-selection system
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Dec 9, 2023
1 parent 8359aa7 commit a434925
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/image_customization_lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ local function collect_keys(t)
return ret
end

function M.get_selection(selection_type, files, env, dev)
local function evaluate_device(files, env, dev)
local selections = {}
local funcs = {}
local device_disabled = false

local function add_elements(element_type, element_list)
for _, element in ipairs(element_list) do
Expand Down Expand Up @@ -74,7 +75,15 @@ function M.get_selection(selection_type, files, env, dev)
f()
end

return collect_keys(selections[selection_type] or {})
return {
selections = selections,
device_disabled = device_disabled,
}
end

function M.get_selection(selection_type, files, env, dev)
local eval_result = evaluate_device(files, env, dev)
return collect_keys(eval_result.selections[selection_type] or {})
end

return M

0 comments on commit a434925

Please sign in to comment.