2023-09-09 20:52:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
PID=$(pidof delphi.market)
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
function restart_server() {
|
2023-09-09 20:52:51 +00:00
|
|
|
set +e
|
2023-09-09 20:52:50 +00:00
|
|
|
[[ -z "$PID" ]] || kill -15 $PID
|
|
|
|
ENV=development make build -B
|
2023-09-09 20:52:51 +00:00
|
|
|
set -e
|
2024-07-10 04:11:28 +00:00
|
|
|
tailwindcss -i public/css/_tw-input.css -o public/css/tailwind.css
|
2024-07-10 02:48:45 +00:00
|
|
|
templ generate -path server/router/pages
|
|
|
|
go build -o delphi.market .
|
2023-09-09 20:52:50 +00:00
|
|
|
./delphi.market >> server.log 2>&1 &
|
2024-07-10 02:48:45 +00:00
|
|
|
templ generate -path server/router/pages
|
2023-09-09 20:52:50 +00:00
|
|
|
PID=$(pidof delphi.market)
|
|
|
|
}
|
|
|
|
|
2023-09-10 15:39:34 +00:00
|
|
|
function restart() {
|
2023-09-09 20:52:50 +00:00
|
|
|
restart_server
|
|
|
|
date +%s.%N > public/hotreload
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleanup() {
|
|
|
|
rm -f public/hotreload
|
|
|
|
[[ -z "$PID" ]] || kill -15 $PID
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
2023-09-10 15:39:34 +00:00
|
|
|
restart
|
2023-09-09 20:52:51 +00:00
|
|
|
tail -f server.log &
|
|
|
|
|
2023-09-10 15:39:34 +00:00
|
|
|
while inotifywait -r -e modify db/ env/ lib/ lnd/ pages/ public/ server/; do
|
|
|
|
restart
|
2023-09-09 20:52:50 +00:00
|
|
|
done
|