mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-20 15:56:51 +00:00
Merge pull request #237 from kk7ds/preview-bind
Allow preview with a different bind address
This commit is contained in:
commit
40cc9ec95e
5
Rakefile
5
Rakefile
@ -77,13 +77,14 @@ task :watch do
|
||||
end
|
||||
|
||||
desc "preview the site in a web browser"
|
||||
task :preview do
|
||||
task :preview, :listen do |t, args|
|
||||
listen_addr = args[:listen] || '127.0.0.1'
|
||||
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
|
||||
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
|
||||
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
|
||||
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch --incremental")
|
||||
compassPid = Process.spawn("compass watch")
|
||||
rackupPid = Process.spawn("rackup --port #{server_port}")
|
||||
rackupPid = Process.spawn("rackup --port #{server_port} --host #{listen_addr}")
|
||||
|
||||
trap("INT") {
|
||||
[jekyllPid, compassPid, rackupPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
|
||||
|
Loading…
x
Reference in New Issue
Block a user