title: jekyll serve and launch
body: <p>Being lazy, I would like to chain the following two commands so that it will work with one simple bash alias.</p>
  
  <pre><code>jekyll -w serve
  </code></pre>
  
  <p>starts up the development server for my jekyll instance.</p>
  
  <pre><code>open "http://localhost:4000"
  </code></pre>
  
  <p>launches my jekyll application in my default browser.</p>
  
  <p>How can I chain them together so that I can type <em>one simple alias</em> in my command line to serve and launch?</p>
  
  <p><strong>NOTES</strong></p>
  
  <ul>
  <li><p>Note using either <code>&amp;&amp;</code> or <code>;</code> to chain <code>jekyll -w serve</code> and <code>open "http://localhost:4000"</code> will not work because the <code>jekyll -w serve</code> launches the persistent webrick process in stdout.  Which means that the 2nd command <code>open "http://localhost:4000"</code> will not be executed because the first process (webrick) never did "complete".</p></li>
  <li><p>When webrick starts, we can see a typical output as follows:-</p></li>
  </ul>
  
  <blockquote>
  <pre><code>Configuration file: /Users/calvin/work/calviny/_config.yml
              Source: /Users/calvin/work/calviny
         Destination: /Users/calvin/work/calviny/_site
        Generating... done.
   Auto-regeneration: enabled
  [2013-09-08 18:43:58] INFO  WEBrick 1.3.1
  [2013-09-08 18:43:58] INFO  ruby 1.9.3 (2013-06-27) [x86_64-darwin11.4.2]
  [2013-09-08 18:43:58] INFO  WEBrick::HTTPServer#start: pid=6183 port=4000
  </code></pre>
  </blockquote>