forked from Edgio/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
32 lines (26 loc) · 720 Bytes
/
Rakefile
File metadata and controls
32 lines (26 loc) · 720 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
require 'redcard/1.9'
def preview(browser=false)
pids = [
Process.spawn("bundle exec jekyll serve --config \"_config.yml,_config_dev.yml\"")
]
if browser
STDERR.puts "Opening a browser to preview the site..."
STDERR.puts " You may need to refresh the page if the server hasn't loaded yet."
sleep 2
pids << Process.spawn("bundle exec launchy http://localhost:9876")
end
Signal.trap "INT" do
pids.each { |pid| Process.kill :INT, pid }
end
Process.waitall
end
desc "Build the site and host it localhost:9876"
task :preview do
preview
end
namespace :preview do
desc "Build the site and open localhost:9876 in the default browser"
task :browser do
preview true
end
end