diff options
author | Kevin W. Gisi <kevin@kevingisi.com> | 2010-08-03 13:25:54 +0800 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2010-08-03 19:57:01 +0800 |
commit | 1f4fcec53bf68291deaa31a05023022c42c7e39a (patch) | |
tree | f080139b1351c8df88fea3784cdba4d6d827e5a0 | |
parent | 9bd713395333411f4576498b2fbb190f7970901d (diff) | |
download | my_new_personal_website-1f4fcec53bf68291deaa31a05023022c42c7e39a.tar.xz my_new_personal_website-1f4fcec53bf68291deaa31a05023022c42c7e39a.zip |
Correctly check for failing Serve
-rw-r--r-- | Rakefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -165,8 +165,11 @@ desc "start up an instance of serve on the output files" task :start_serve => :stop_serve do cd "#{site}" do print "Starting serve..." - ok_failed system("serve #{port} > /dev/null 2>&1 &") - system "open http://localhost:#{port}" + system("serve #{port} > /dev/null 2>&1 &") + 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 |