mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-15 13:45:00 -05:00
Correctly check for failing Serve
This commit is contained in:
parent
9bd7133953
commit
1f4fcec53b
7
Rakefile
7
Rakefile
@ -165,8 +165,11 @@ desc "start up an instance of serve on the output files"
|
|||||||
task :start_serve => :stop_serve do
|
task :start_serve => :stop_serve do
|
||||||
cd "#{site}" do
|
cd "#{site}" do
|
||||||
print "Starting serve..."
|
print "Starting serve..."
|
||||||
ok_failed system("serve #{port} > /dev/null 2>&1 &")
|
system("serve #{port} > /dev/null 2>&1 &")
|
||||||
system "open http://localhost:#{port}"
|
sleep 1
|
||||||
|
pid = `ps auxw | awk '/bin\\/serve\\ #{port}/ { print $2 }'`.strip
|
||||||
|
ok_failed !pid.empty?
|
||||||
|
system "open http://localhost:#{port}" unless pid.empty?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user