Skip to content

fix: quoting args if lua directive and not --ignore-lua#751

Open
brunotvs wants to merge 1 commit intolunarmodules:masterfrom
brunotvs:master
Open

fix: quoting args if lua directive and not --ignore-lua#751
brunotvs wants to merge 1 commit intolunarmodules:masterfrom
brunotvs:master

Conversation

@brunotvs
Copy link

@brunotvs brunotvs commented Jan 5, 2025

Fixes #750

@Tieske
Copy link
Member

Tieske commented Mar 3, 2026

@brunotvs apologies for the long delay, any chance you can rebase this on current master? Thx!

@brunotvs
Copy link
Author

brunotvs commented Mar 6, 2026

@Tieske, done.

@Tieske
Copy link
Member

Tieske commented Mar 6, 2026

@brunotvs what happened? the change set is much bigger now? and most are unrelated formatting things. Is this on purpose?
Can you please remove them again? to keep the git history clean

@brunotvs
Copy link
Author

brunotvs commented Mar 6, 2026

Sorry, must've forgotten to disable autofmt.

Comment on lines +216 to +219
for _, arg in ipairs(args) do
local a = arg:gsub('"', '\\"')
table.insert(quoted, a)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this slightly more compact?

Suggested change
for _, arg in ipairs(args) do
local a = arg:gsub('"', '\\"')
table.insert(quoted, a)
end
for i, arg in ipairs(args) do
quoted[i] = arg:gsub('"', '\\"')
end

end
local _, code = execute(
cliArgs['lua']..' '..args[0] or ''..' --ignore-lua '..table.concat(args, ' ')
cliArgs["lua"] .. " " .. args[0] .. ' --ignore-lua ' .. end_args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed the or fallback here, was that on purpose?

Suggested change
cliArgs["lua"] .. " " .. args[0] .. ' --ignore-lua ' .. end_args
cliArgs["lua"] .. " " .. (args[0] or "") .. ' --ignore-lua ' .. end_args

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

If lua, quoted arguments loose quote

2 participants