all repos — site @ e521d2780f5616382538ccea62c993fc190c4bdf

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