I start my blog with Jekyll , and I thought it would be nice to automatically open the site in a new browser tab when the local development server finishes launching.
When you run jekyll serve , you have the following output, for example:
Configuration file: /Users/jgt/Sites/jezen.imtqy.com/_config.yml Source: /Users/jgt/Sites/jezen.imtqy.com Destination: dist Generating... done. Configuration file: /Users/jgt/Sites/jezen.imtqy.com/_config.yml Server address: http:
I was thinking of running jekyll serve in a subshell and listening to its output. Perhaps I could simultaneously run a parallel endless loop that reads some stdout and runs open http://0.0.0.0:4000 : open http://0.0.0.0:4000 , and then exits when the line "Server is running" matches. My bash-fu is not yet at a level where I can hack something.
How do I approach this?
source share