Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use log task options to set lines count to show

This commmit doesn't break log task API, passing number should be
used instead of task option.
  • Loading branch information...
commit 26e24d0ee5492c7b505d412ee9511f95b2952943 1 parent 446214e
@yannlugrin yannlugrin authored committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/git_deploy.rb
View
7 lib/git_deploy.rb
@@ -64,10 +64,11 @@ def rollback
invoke :restart
end
- desc "log [n=20]", "Shows the last part of the deploy log on the server"
+ desc "log", "Shows the last part of the deploy log on the server"
method_option :tail, :aliases => '-t', :type => :boolean, :default => false
- def log(n = 20)
- tail_args = options.tail? ? '-f' : "-n#{n}"
+ method_option :lines, :aliases => '-l', :type => :numeric, :default => 20
+ def log(n = nil)
+ tail_args = options.tail? ? '-f' : "-n#{n || options.lines}"
run "tail #{tail_args} #{deploy_to}/log/deploy.log"
end
Please sign in to comment.
Something went wrong with that request. Please try again.