Skip to content

Commit

Permalink
escape is better than replacement #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Masashi Terui committed Jun 25, 2015
1 parent 3bdaa83 commit d45f895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kitchen/transport/docker_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def docker_exec_command(container_id, cmd, opt = {})
exec_cmd = "exec"
exec_cmd << " -t" if opt[:tty]
exec_cmd << " -i" if opt[:interactive]
cmd = Util.wrap_command(cmd.gsub('\'', '"')) unless cmd.match(/\Ash\s\-c/)
cmd = Util.wrap_command(cmd.gsub("'", "'\\\\''")) unless cmd.match(/\Ash\s\-c/)
exec_cmd << " #{container_id} #{cmd}"
end

Expand Down

0 comments on commit d45f895

Please sign in to comment.