site

A custom static site generator written in C.
git clone https://unitehenry.com/git/site.git
Log | Files | Refs | README

serve (299B)


      1 #!/usr/bin/env bash
      2 pkill -f http-server 2>/dev/null || true
      3 
      4 sleep 1
      5 
      6 npx http-server -c-1 build &
      7 
      8 HTTP_PID=$!
      9 
     10 cleanup() {
     11     kill $HTTP_PID
     12 }
     13 
     14 trap cleanup SIGINT SIGTERM
     15 
     16 TEMP_FILES=$(mktemp)
     17 
     18 find content >> $TEMP_FILES
     19 
     20 find static >> $TEMP_FILES
     21 
     22 cat $TEMP_FILES | entr -n scripts/generate