Skip to content

Commit

Permalink
fixes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Feb 27, 2024
1 parent b22aac1 commit b83a326
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions scripts/workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ local function create(workdir, parent, attri)
end
end

function mt:__call(_, new_attri)
for k, v in pairs(new_attri) do
if arguments.args[k] == nil then
if ATTRIBUTE[k] == AttributePaths or ATTRIBUTE[k] == AttributeStrings then
local t = {}
push_strings(t, parent[k])
push_strings(t, v)
attri[k] = t
else
attri[k] = v
end
end
end
end

if globals == attri then
function mt:__pairs()
return function (_, k)
Expand Down
4 changes: 3 additions & 1 deletion scripts/writer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,9 @@ function api.conf(global_attribute, name)
if type(name) == "table" then
local local_attribute = name
local root = normalize_rootdir(global_attribute.workdir, local_attribute.rootdir or global_attribute.rootdir)
workspace.resolve_attributes(global_attribute, local_attribute, root)
local attribute = {}
workspace.resolve_attributes(attribute, local_attribute, root)
global_attribute("set", attribute)
else
log.assert(type(name) == "string", "Name is not a string.")
return function (local_attribute)
Expand Down

0 comments on commit b83a326

Please sign in to comment.