Being lazy, I would like to combine the following two commands so that it works with one simple alias bash.
jekyll -w serve
starts the development server for my jekyll instance.
open "http://localhost:4000"
launches my jekyll application in my default browser.
How can I link them together so that I can type one simple alias on my command line for maintenance and startup?
NOTES
Please note that using && or ; for the jekyll -w serve and open "http://localhost:4000" chain open "http://localhost:4000" will not work, because jekyll -w serve starts the constant webrick process in stdout. This means that the second open "http://localhost:4000" command open "http://localhost:4000" will not be executed because the first process (webrick) never "terminated".
When webrick begins, we can see a typical output as follows: -
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
source share