Improved output for auto-regeneration.
This commit is contained in:
parent
bf79b0ac37
commit
9eb79ff135
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue