Improved output for auto-regeneration.

This commit is contained in:
Parker Moore 2013-02-03 20:36:34 +01:00
parent bf79b0ac37
commit 9eb79ff135
1 changed files with 6 additions and 3 deletions

View File

@ -50,7 +50,9 @@ module Jekyll
source = options['source'] source = options['source']
destination = options['destination'] destination = options['destination']
puts "Auto-Regenerating enabled: #{source} -> #{destination}" puts " Source: #{source}"
puts " Destination: #{destination}"
puts " Auto-regeneration: enabled"
dw = DirectoryWatcher.new(source) dw = DirectoryWatcher.new(source)
dw.interval = 1 dw.interval = 1
@ -58,15 +60,16 @@ module Jekyll
dw.add_observer do |*args| dw.add_observer do |*args|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S") t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
puts "[#{t}] regeneration: #{args.size} files changed" print " Regenerating: #{args.size} files at #{t} "
site.process site.process
puts "...done."
end end
dw.start dw.start
unless options['serving'] unless options['serving']
trap("INT") do trap("INT") do
puts "Stopping auto-regeneration..." puts " Halting auto-regeneration."
exit 0 exit 0
end end