experimental builder inside of server
This commit is contained in:
parent
7a94f63877
commit
4e91bf4d69
1 changed files with 17 additions and 0 deletions
|
@ -1,5 +1,22 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
# Non-blocking site rebuilding
|
||||||
|
trap("TSTP") do
|
||||||
|
fork do
|
||||||
|
require "open3"
|
||||||
|
first_run = true
|
||||||
|
Open3.popen3(%Q{cd "#{Dir.pwd}" && mm-build | grep FORCED}) do |stdin, stdout, stderr|
|
||||||
|
puts "\n== Building the site..."
|
||||||
|
stdout.readlines.each do |l|
|
||||||
|
puts "== Updated:" if first_run
|
||||||
|
puts " " + l.split("[FORCED]").last.chomp
|
||||||
|
first_run = false
|
||||||
|
end
|
||||||
|
puts "== Build complete"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
|
|
||||||
# Require Middleman
|
# Require Middleman
|
||||||
|
|
Loading…
Reference in a new issue