Browse Source

Do not rely on system specifc syntax for preview or watch.

unreleased_contents
Benjamin R Doerr 13 years ago
parent
commit
efb7522491
  1. 34
      Rakefile

34
Rakefile

@ -50,12 +50,42 @@ end
desc "Watch the site and regenerate when it changes" desc "Watch the site and regenerate when it changes"
task :watch do task :watch do
system "trap 'kill $jekyllPid $compassPid' Exit; jekyll --auto & jekyllPid=$!; compass watch & compassPid=$!; wait" require 'compass'
require 'compass/exec'
puts "Starting to watch source with Jekyll and Compass."
jekyllPid = spawn("jekyll --auto")
compassPid = spawn("compass watch")
trap("INT") {
Process.kill(9, jekyllPid)
Process.kill(9, compassPid)
puts "Waiting for Jekyll and Compass to die."
sleep 5
puts "Done waiting. Bye bye."
exit 0
}
Process.wait
end end
desc "preview the site in a web browser" desc "preview the site in a web browser"
task :preview do task :preview do
system "trap 'kill $jekyllPid $compassPid $rackPid' Exit; jekyll --auto & jekyllPid=$!; compass watch & compassPid=$!; rackup --port #{server_port} & rackPid=$!; wait" puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
jekyllPid = spawn("jekyll --auto")
compassPid = spawn("compass watch")
rackupPid = spawn("rackup --port #{server_port}")
trap("INT") {
Process.kill(9, jekyllPid)
Process.kill(9, compassPid)
Process.kill(9, rackupPid)
puts "Waiting for Jekyll, Compass and Rack to die."
sleep 10
puts "Done waiting. Bye bye."
exit 0
}
Process.wait
end end
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post") # usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")

Loading…
Cancel
Save