Permalink
Browse files

output of STDERR fixed

  • Loading branch information...
1 parent dc4c4d6 commit 0c60c178abf83fbae4546308dc7642f2441b8b1e @julius committed Apr 19, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 watch
View
@@ -19,8 +19,10 @@ end
@@last_exec = nil
def exec_cmd
+ # execute given command only every 3 seconds
if (@@last_exec.nil? || Time.new > @@last_exec + 3)
- puts `#{ARGV[1]}`
+ # 2>&1 redirect STDERR into terminal output
+ puts `#{ARGV[1]} 2>&1`
@@last_exec = Time.new
end
end
@@ -31,7 +33,7 @@ exec_cmd
fsevents_cb = proc do |stream, ctx, numEvents, paths, marks, eventIDs|
paths.regard_as('*')
numEvents.times do |n|
- puts "Event on path `#{paths[n]}' ID `#{eventIDs[n]}'"
+ puts "[watch] ==> #{paths[n]}"
exec_cmd
end
end

0 comments on commit 0c60c17

Please sign in to comment.