Swap grep context with grep options
This commit is contained in:
@@ -36,17 +36,17 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base
|
||||
end
|
||||
|
||||
|
||||
def logs(since: nil, lines: nil, grep: nil, context: nil)
|
||||
def logs(since: nil, lines: nil, grep: nil, grep_options: nil)
|
||||
pipe \
|
||||
docker(:logs, service_name, (" --since #{since}" if since), (" --tail #{lines}" if lines), "--timestamps", "2>&1"),
|
||||
("grep '#{grep}'#{" -C #{context}" if context}" if grep)
|
||||
("grep '#{grep}'#{" #{grep_options}" if grep_options}" if grep)
|
||||
end
|
||||
|
||||
def follow_logs(grep: nil, context: nil)
|
||||
def follow_logs(grep: nil, grep_options: nil)
|
||||
run_over_ssh \
|
||||
pipe \
|
||||
docker(:logs, service_name, "--timestamps", "--tail", "10", "--follow", "2>&1"),
|
||||
(%(grep "#{grep}"#{" -C #{context}" if context}) if grep)
|
||||
(%(grep "#{grep}"#{" #{grep_options}" if grep_options}) if grep)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user