forked from web-development/web-development-textbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
30 lines (25 loc) · 642 Bytes
/
Rakefile
File metadata and controls
30 lines (25 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
desc "Compile the site"
task :compile => [:clean] do
puts "Compiling site"
out = `LANG=en_US.UTF-8 bundle exec nanoc compile > logs/compile.log 2>&1`
if $?.to_i == 0
puts "Compilation succeeded"
else
abort "Compilation failed: #{$?.to_i}\n" +
"#{out}\n"
end
sh './deploy.sh'
end
desc "start server"
task :start do
puts "Starting web server"
out = `LANG=en_US.UTF-8 bundle exec nanoc view & > logs/view.log 2>&1 `
end
task :clean do
FileUtils.rm_r('output') if File.exist?('output')
end
task :test do
require 'html-proofer'
HTMLProofer.check_directory('output').run
end
task :default => 'compile'