summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorKyren223 <contact@kyren.codes>2026-10-08 19:44:46 +0300
committerKyren223 <contact@kyren.codes>2026-10-08 19:44:46 +0300
commit9b03d2790b8b8db1b5a6755b6130f37e5f7f2455 (patch)
treea84f6e9cfe2b8aaf087d55830c938443f6be683e /run.sh
parent6e70fe447ec9504757fbdc152b5b3697c9af8def (diff)
WIP
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..578be5e
--- /dev/null
+++ b/run.sh
@@ -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."