mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
Allow preview with a different bind address
This makes the Rakefile preview task honor a listen address instead of always defaulting to 127.0.0.1. This makes it easier to run the preview on a machine other than where you have a web browser running. To use: rake preview[0.0.0.0]
This commit is contained in:
parent
dbf2688464
commit
970e6aa96d
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