Skip to content

Commit

Permalink
Fix excess spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Sep 20, 2024
1 parent d985009 commit 487f6f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/kamal/commands/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def version

def logs(timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil)
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)
end

Expand Down
6 changes: 3 additions & 3 deletions test/commands/proxy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ class CommandsProxyTest < ActiveSupport::TestCase

test "proxy logs since 2h" do
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(" ")
end

test "proxy logs last 10 lines" do
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(" ")
end

test "proxy logs without timestamps" do
assert_equal \
"docker logs kamal-proxy 2>&1",
"docker logs kamal-proxy 2>&1",
new_command.logs(timestamps: false).join(" ")
end

Expand Down

0 comments on commit 487f6f5

Please sign in to comment.