From 678d0c386ab05f48e866c4814bc20bb7de51fbe9 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 28 Sep 2010 10:49:48 -0700 Subject: Do not append/output if no new lines. --- lognotify.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lognotify.rb') diff --git a/lognotify.rb b/lognotify.rb index 8996869..4c5c494 100755 --- a/lognotify.rb +++ b/lognotify.rb @@ -91,9 +91,11 @@ ARGV.each do |identifier| puts '* Number of new lines: ' + newlines.lines.count.to_s - print '* Appending new lines to cached log... ' - append_lines(identifier, newlines) - puts 'Done' + unless newlines.lines.count.zero? + print '* Appending new lines to cached log... ' + append_lines(identifier, newlines) + puts 'Done' - puts newlines + puts newlines + end end -- cgit v1.2.3-70-g09d2