all repos — site @ eb5ceb8bad0a830d8f6f0b952e745147eec092f6

source for my site, found at icyphox.sh

bin/serve.sh (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
#!/usr/bin/env bash

vite="$1"
if [ -z "$vite" ]; then
    vite="vite"
fi

echo "using vite command: $vite"

kill_vite() {
    trap SIGINT
    echo "cleaning up..."
    pkill vite
    exit
}
trap "kill_vite" INT

"$vite" serve &
find pages/ static/ templates/ | entr "$vite" build

trap SIGINT