Fix excess spacing

This commit is contained in:
David Heinemeier Hansson
2024-09-20 08:31:56 -07:00
parent d98500982d
commit 487f6f5f53
2 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ class Kamal::Commands::Proxy < Kamal::Commands::Base
def logs(timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil) def logs(timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil)
pipe \ pipe \
docker(:logs, container_name, (" --since #{since}" if since), (" --tail #{lines}" if lines), ("--timestamps" if timestamps), "2>&1"), docker(:logs, container_name, ("--since #{since}" if since), ("--tail #{lines}" if lines), ("--timestamps" if timestamps), "2>&1"),
("grep '#{grep}'#{" #{grep_options}" if grep_options}" if grep) ("grep '#{grep}'#{" #{grep_options}" if grep_options}" if grep)
end end

View File

@@ -67,19 +67,19 @@ class CommandsProxyTest < ActiveSupport::TestCase
test "proxy logs since 2h" do test "proxy logs since 2h" do
assert_equal \ assert_equal \
"docker logs kamal-proxy --since 2h --timestamps 2>&1", "docker logs kamal-proxy --since 2h --timestamps 2>&1",
new_command.logs(since: "2h").join(" ") new_command.logs(since: "2h").join(" ")
end end
test "proxy logs last 10 lines" do test "proxy logs last 10 lines" do
assert_equal \ assert_equal \
"docker logs kamal-proxy --tail 10 --timestamps 2>&1", "docker logs kamal-proxy --tail 10 --timestamps 2>&1",
new_command.logs(lines: 10).join(" ") new_command.logs(lines: 10).join(" ")
end end
test "proxy logs without timestamps" do test "proxy logs without timestamps" do
assert_equal \ assert_equal \
"docker logs kamal-proxy 2>&1", "docker logs kamal-proxy 2>&1",
new_command.logs(timestamps: false).join(" ") new_command.logs(timestamps: false).join(" ")
end end