diff options
Diffstat (limited to 'run.sh')
| -rwxr-xr-x | run.sh | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +cleanup() { + trap - SIGINT SIGTERM EXIT + kill $(jobs -p) 2>/dev/null || true +} +trap cleanup SIGINT SIGTERM EXIT + +# templ generate --watch --proxy="http://localhost:8080" --cmd="DEV=1 go run ." --watch-pattern='.*' & +templ generate --watch --proxy="http://localhost:8080" --cmd="DEV=1 go run ." --watch-pattern='(.+\.go$)|(.+\.templ$)|(.+_templ\.txt$)|(.+\.css$)|(.+\.js$)|(.+\.md$)|(.+\.svg$)|(.+\.json$)|(.+\.html$)|(.+\.txt$)|(.+\.ttf$)|(.+\.woff2?$)|(.+\.png$)|(.+\.jpg$)|(.+\.webp$)' & +TEMPL_PID=$! + +tail -f /dev/null | tailwindcss -i ./public/main.css -o ./public/style.css --watch & +TAILWIND_PID=$! + +echo "[dev] Watching Templ (PID $TEMPL_PID) and Tailwind (PID $TAILWIND_PID)..." + +wait -n + +echo "[dev] A background process exited unexpectedly." |
