Fix excess spacing
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user