Skip to content

If lua, quoted arguments loose quote #750

Open
@brunotvs

Description

@brunotvs

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions