-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRakefile
36 lines (31 loc) · 882 Bytes
/
Rakefile
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
36
require 'rake/clean'
CLEAN.include '.jekyll-cache', '.sass-cache', '.git-metadata'
task default: %w[clean build]
task :build do |t, args|
cmd = %w[bundle exec jekyll build]
cmd << '--profile' if ENV['CI']
cmd << '--trace'
cmd << '--lsi' if ENV['LSI']
cmd << '--watch' if args.extras.include? 'watch'
unless ENV['JEKYLL_ENV'] == 'production'
cmd.concat(%w[--config _config.yml,_local.yml]) if File.file? '_local.yml'
end
begin
sh(*cmd)
rescue Interrupt
end
end
task :watch do
ENV['JEKYLL_ENV'] ||= 'development'
Rake::Task[:build].invoke('watch')
end
task :serve, %i[port] do |t, args|
cmd = %w[bundle exec jekyll serve]
cmd.concat(['--port', args.port]) unless args.port.nil?
cmd.concat(%w[--config _config.yml,_local.yml]) if File.file? '_local.yml'
begin
ENV['JEKYLL_ENV'] = 'development'
sh(*cmd)
rescue Interrupt
end
end