...
|
...
|
@@ -165,8 +165,11 @@ desc "start up an instance of serve on the output files"
|
165
|
165
|
task :start_serve => :stop_serve do
|
166
|
166
|
cd "#{site}" do
|
167
|
167
|
print "Starting serve..."
|
168
|
|
- ok_failed system("serve #{port} > /dev/null 2>&1 &")
|
169
|
|
- system "open http://localhost:#{port}"
|
|
168
|
+ system("serve #{port} > /dev/null 2>&1 &")
|
|
169
|
+ sleep 1
|
|
170
|
+ pid = `ps auxw | awk '/bin\\/serve\\ #{port}/ { print $2 }'`.strip
|
|
171
|
+ ok_failed !pid.empty?
|
|
172
|
+ system "open http://localhost:#{port}" unless pid.empty?
|
170
|
173
|
end
|
171
|
174
|
end
|
172
|
175
|
|