Created
July 26, 2011 20:33
-
-
Save timothyekl/1107942 to your computer and use it in GitHub Desktop.
Watch a directory recursively, recompiling .tex files on changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rb-inotify' | |
notifier = INotify::Notifier.new | |
notifier.watch('.', :modify, :recursive) do |event| | |
if event.name.end_with? ".tex" | |
puts "#{`date`.chomp}: Modified #{event.name}; recompiling..." | |
`pdflatex -interaction batchmode -output-directory #{File.dirname(event.absolute_name)} #{event.absolute_name} > /dev/null 2>&1` | |
end | |
end | |
notifier.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out that
rb-inotify
has a:recursive
option.