Escape single quotes to fix log following

Fixes: https://github.com/basecamp/kamal/issues/777
This commit is contained in:
Donal McBreen
2024-04-26 14:16:19 +01:00
parent d475e88dbe
commit 1f5b936fa2
3 changed files with 7 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ module Kamal::Commands
elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
end
cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ")}'"
cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
end
end