Permalink
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...
1 parent 446214e commit 26e24d0ee5492c7b505d412ee9511f95b2952943 @yannlugrin yannlugrin committed with mislav Dec 10, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/git_deploy.rb
View
@@ -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

0 comments on commit 26e24d0

Please sign in to comment.