I'm trying to write a script that launches Jekyll from the command line, does another process, and then stops it.
The logic would be like this:
- start jekyll serve.
- run a process called Prince to build a PDF from the HTML files.
- stop the jekyll server.
I'm not very experienced with the command line. I think I have to use the --detach
command with Jekyll to continue running scripts after the preview server builds. But then if I detach Jekyll, the only way to stop the server is by killing a specific PID, but the PID number seems to be generated randomly.
Anyone have any tips on how to construct this script?