Skip to content

Commit

Permalink
fix: make append options work when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Nov 21, 2023
1 parent 7801dec commit cda3a0d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/cartesi-machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,13 @@ local options = {
{
"^%-%-append%-bootargs%=(.*)$",
function(o)
if not o or #o < 1 then return false end
append_bootargs = o
if not o then return false end
if #o == 0 then return true end
if #append_bootargs == 0 then
append_bootargs = o
else
append_bootargs = append_bootargs .. " " .. o
end
return true
end,
},
Expand Down Expand Up @@ -1142,7 +1147,8 @@ local options = {
{
"^%-%-append%-init%=(.*)$",
function(o)
if not o or #o < 1 then return false end
if not o then return false end
if #o == 0 then return true end
append_init = append_init .. o .. "\n"
return true
end,
Expand All @@ -1161,7 +1167,8 @@ local options = {
{
"^%-%-append%-entrypoint%=(.*)$",
function(o)
if not o or #o < 1 then return false end
if not o then return false end
if #o == 0 then return true end
append_entrypoint = append_entrypoint .. o .. "\n"
return true
end,
Expand Down

0 comments on commit cda3a0d

Please sign in to comment.