|
|
@ -60,12 +60,11 @@ task :watch do
|
|
|
|
compassPid = Process.spawn("compass watch")
|
|
|
|
compassPid = Process.spawn("compass watch")
|
|
|
|
|
|
|
|
|
|
|
|
trap("INT") {
|
|
|
|
trap("INT") {
|
|
|
|
Process.kill(9, jekyllPid)
|
|
|
|
[jekyllPid, compassPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
|
|
|
|
Process.kill(9, compassPid)
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Process.wait
|
|
|
|
[jekyllPid, compassPid].each { |pid| Process.wait(pid) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
desc "preview the site in a web browser"
|
|
|
|
desc "preview the site in a web browser"
|
|
|
@ -77,13 +76,11 @@ task :preview do
|
|
|
|
rackupPid = Process.spawn("rackup --port #{server_port}")
|
|
|
|
rackupPid = Process.spawn("rackup --port #{server_port}")
|
|
|
|
|
|
|
|
|
|
|
|
trap("INT") {
|
|
|
|
trap("INT") {
|
|
|
|
Process.kill(9, jekyllPid)
|
|
|
|
[jekyllPid, compassPid, rackupPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
|
|
|
|
Process.kill(9, compassPid)
|
|
|
|
exit 0
|
|
|
|
Process.kill(9, rackupPid)
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Process.wait
|
|
|
|
[jekyllPid, compassPid, rackupPid].each { |pid| Process.wait(pid) }
|
|
|
|
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")
|
|
|
|