mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05:00
Grab IP and PORT env vars and bind rack to both
This commit is contained in:
parent
2cebdb91db
commit
329d2c5bda
6
Rakefile
6
Rakefile
@ -28,8 +28,8 @@ posts_dir = "_posts" # directory for blog files
|
||||
themes_dir = ".themes" # directory for blog files
|
||||
new_post_ext = "markdown" # default new post file extension when using the new_post task
|
||||
new_page_ext = "markdown" # default new page file extension when using the new_page task
|
||||
server_port = "4000" # port for preview server eg. localhost:4000
|
||||
|
||||
server_host = ENV['IP'] ||= '0.0.0.0' # host ip address for preview server
|
||||
server_port = ENV['PORT'] ||= "4000" # port for preview server eg. localhost:4000
|
||||
|
||||
desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]"
|
||||
task :install, :theme do |t, args|
|
||||
@ -116,7 +116,7 @@ task :preview do
|
||||
system "compass compile --css-dir #{source_dir}/stylesheets"
|
||||
jekyllPid = Process.spawn("jekyll --auto")
|
||||
compassPid = Process.spawn("compass watch")
|
||||
rackupPid = Process.spawn("rackup --port #{server_port}")
|
||||
rackupPid = Process.spawn("rackup --host #{server_host} --port #{server_port}")
|
||||
|
||||
trap("INT") {
|
||||
[jekyllPid, compassPid, rackupPid].each { |pid| Process.kill(9, pid) rescue Errno::ESRCH }
|
||||
|
Loading…
Reference in New Issue
Block a user