forked from bjelline/web-development-textbook
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathRakefile
More file actions
35 lines (28 loc) · 727 Bytes
/
Rakefile
File metadata and controls
35 lines (28 loc) · 727 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
31
32
33
34
35
# frozen_string_literal: true
require 'English'
require 'English'
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 $CHILD_STATUS.to_i.zero?
puts 'Compilation succeeded'
else
abort "Compilation failed: #{$CHILD_STATUS.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'