summaryrefslogtreecommitdiff
path: root/lognotify.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 10:49:48 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 10:49:48 -0700
commit678d0c386ab05f48e866c4814bc20bb7de51fbe9 (patch)
treec090f169476dc15d2a3d0930042a3a615cfba95b /lognotify.rb
parent58789b9d5107a1e3ab73e3f3e0bfe810a2ae8b36 (diff)
downloadlognotify-678d0c386ab05f48e866c4814bc20bb7de51fbe9.tar.gz
lognotify-678d0c386ab05f48e866c4814bc20bb7de51fbe9.tar.xz
Do not append/output if no new lines.
Diffstat (limited to 'lognotify.rb')
-rwxr-xr-xlognotify.rb10
1 files changed, 6 insertions, 4 deletions
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