vegan-prestwich/bin/serve

18 lines
385 B
Plaintext
Raw Normal View History

2025-01-08 22:34:47 +00:00
#!/usr/bin/env bash
yarn eleventy --serve &
ELEVENTY_PID=$!
sass --watch style:_site/style --style compressed &
SASS_PID=$!
cleanup_serve() {
echo "Cleaning up serve processes..."
kill $ELEVENTY_PID 2>/dev/null
wait $ELEVENTY_PID 2>/dev/null
kill $SASS_PID 2>/dev/null
wait $SASS_PID 2>/dev/null
}
trap cleanup_serve EXIT INT TERM
wait -n
cleanup_serve
trap - EXIT INT TERM