all repos — site @ c53eb9f1b57d46b6f6b5365c582536613509cb2f

source for my site, found at icyphox.sh

bin/serve.sh (view raw)

 1#!/usr/bin/env bash
 2
 3vite="$1"
 4if [ -z "$vite" ]; then
 5    vite="vite"
 6fi
 7
 8echo "using vite command: $vite"
 9
10kill_vite() {
11    trap SIGINT
12    echo "cleaning up..."
13    pkill vite
14    exit
15}
16trap "kill_vite" INT
17
18"$vite" serve &
19find pages/ static/ templates/ | entr "$vite" build --drafts
20
21trap SIGINT