2024-01-14 02:50:37 +01:00
|
|
|
namespace :nanoc do
|
|
|
|
desc "Produce the build/ directory"
|
|
|
|
task :build do
|
2024-01-14 05:51:44 +01:00
|
|
|
# FIXME: discover why rm -rf build/css/ is needed.
|
2024-02-07 23:50:59 +01:00
|
|
|
ENV["NODE_ENV"] = "production"
|
2024-01-14 05:51:44 +01:00
|
|
|
sh "rm -rf build/css/"
|
2024-01-14 02:50:37 +01:00
|
|
|
sh "nanoc co"
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Produce the build/ directory on-demand"
|
|
|
|
task watch: ['nanoc:build'] do
|
|
|
|
require "listen"
|
|
|
|
path = File.join(Dir.getwd, "src")
|
|
|
|
Listen.to(path) { sh "rake nanoc:build" }.start
|
|
|
|
sleep
|
|
|
|
rescue Interrupt
|
|
|
|
warn "SIGINT: exit"
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
end
|