File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,28 @@ export RACK_ENV=${RACK_ENV:-development}
1212
1313# Cleanup function for graceful shutdown
1414cleanup () {
15- kill $RUBY_PID 2> /dev/null || true
16- kill $ASTRO_PID 2> /dev/null || true
17- wait $RUBY_PID 2> /dev/null || true
18- wait $ASTRO_PID 2> /dev/null || true
15+ echo " "
16+ echo " 🛑 Shutting down development servers..."
17+
18+ # Kill Ruby server
19+ if [ ! -z " $RUBY_PID " ]; then
20+ kill $RUBY_PID 2> /dev/null || true
21+ wait $RUBY_PID 2> /dev/null || true
22+ fi
23+
24+ # Kill Astro server and its children
25+ if [ ! -z " $ASTRO_PID " ]; then
26+ # Kill the npm process and its children
27+ pkill -P $ASTRO_PID 2> /dev/null || true
28+ kill $ASTRO_PID 2> /dev/null || true
29+ wait $ASTRO_PID 2> /dev/null || true
30+ fi
31+
32+ # Clean up any remaining processes on our ports
33+ pkill -f " puma.*html2rss-web" 2> /dev/null || true
34+ pkill -f " astro.*dev.*3001" 2> /dev/null || true
35+
36+ echo " ✅ Development servers stopped"
1937 exit 0
2038}
2139
You can’t perform that action at this time.
0 commit comments