Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If lua, quoted arguments loose quote #750

Open
brunotvs opened this issue Jan 4, 2025 · 0 comments · May be fixed by #751
Open

If lua, quoted arguments loose quote #750

brunotvs opened this issue Jan 4, 2025 · 0 comments · May be fixed by #751

Comments

@brunotvs
Copy link

brunotvs commented Jan 4, 2025

Problem:
running busted -e "print('hello')" . works but busted -e "print('hello')" --lua "lua" . doesn't.

Solution: quote args at if lua and not ignore-lua

-- busted/modules/cli.lua: 214
if cliArgs['lua'] and not cliArgs['ignore-lua'] then
  local quoted = {}
  for _, arg in ipairs(args) do
    local a = arg:gsub('"', '\\"')
    table.insert(quoted, a)
  end
  local end_args = ''
  if #quoted >0 then
    end_args = '"' .. table.concat(quoted,'" "') .. '"'
  end
  local _, code = execute(
    cliArgs["lua"] .. " " .. args[0] .. ' --ignore-lua ' .. end_args
  )
  exit(code)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant