diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-09-28 10:49:48 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-09-28 10:49:48 -0700 |
commit | 678d0c386ab05f48e866c4814bc20bb7de51fbe9 (patch) | |
tree | c090f169476dc15d2a3d0930042a3a615cfba95b | |
parent | 58789b9d5107a1e3ab73e3f3e0bfe810a2ae8b36 (diff) | |
download | lognotify-678d0c386ab05f48e866c4814bc20bb7de51fbe9.tar.gz lognotify-678d0c386ab05f48e866c4814bc20bb7de51fbe9.tar.xz |
Do not append/output if no new lines.
-rwxr-xr-x | lognotify.rb | 10 |
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 |