#!/usr/bin/env python3

from __future__ import print_function

import subprocess
import signal
import sys

JEKYLL_PROCESS = subprocess.Popen(["jekyll", "serve"])
subprocess.Popen("pug -w -o _layouts/ _layouts/pug/*.pug", shell=True)

def crash_handler(signal, frame):
    """Handles Ctrl+C crash to kill the jekyll process"""
    print("\nGoodbye")
    JEKYLL_PROCESS.kill()
    sys.exit(0)

signal.signal(signal.SIGINT, crash_handler)
signal.pause()

@@ -155,16 +155,30 @@
 erve%22%5D)%0A
+PUG_PROCESS = 
 subproce
@@ -382,16 +382,39 @@
 .kill()%0A
+    PUG_PROCESS.kill()%0A
     sys.

kill pug process when serve script ends