···1+#!/bin/bash
2+3+# Source both setup scripts
4+source ./scripts/setup-postgres.sh
5+source ./scripts/setup-redis.sh
6+7+# Function to handle cleanup for both services
8+cleanup_and_exit() {
9+ echo "Cleaning up services..."
10+ cleanup_postgres
11+ cleanup_redis
12+ exit 0
13+}
14+15+# Trap SIGINT and SIGTERM to cleanup on exit
16+trap cleanup_and_exit SIGINT SIGTERM
17+18+# Run both services with concurrently
19+concurrently -k -n APP,WORKER -c blue,green \
20+ "dotenv -e .env.local -- concurrently -k -n TYPE,APP -c red,blue \"tsc --noEmit --watch\" \"tsup --watch --onSuccess='node dist/index.js'\"" \
21+ "dotenv -e .env.local -- concurrently -k -n WORKER -c green \"tsup --watch --onSuccess='node dist/workers/feed-worker.js'\""
22+23+# Cleanup after concurrently exits
24+cleanup_postgres
25+cleanup_redis
+15-10
scripts/dev-feed-worker.sh
···3# Source the Redis setup script
4source ./scripts/setup-redis.sh
56-# Function to handle cleanup
7-cleanup_and_exit() {
8- echo "Cleaning up Redis..."
9- cleanup_redis
10- exit 0
11-}
001213-# Trap SIGINT and SIGTERM to cleanup on exit
14-trap cleanup_and_exit SIGINT SIGTERM
01516# Run the feed worker dev command
17npm run dev:worker:feeds:inner
1819-# Cleanup after dev command exits
20-cleanup_redis
00
···3# Source the Redis setup script
4source ./scripts/setup-redis.sh
56+# Only setup cleanup if not running from combined script
7+if [ -z "$COMBINED_SCRIPT" ]; then
8+ # Function to handle cleanup
9+ cleanup_and_exit() {
10+ echo "Cleaning up Redis..."
11+ cleanup_redis
12+ exit 0
13+ }
1415+ # Trap SIGINT and SIGTERM to cleanup on exit
16+ trap cleanup_and_exit SIGINT SIGTERM
17+fi
1819# Run the feed worker dev command
20npm run dev:worker:feeds:inner
2122+# Only cleanup if not running from combined script
23+if [ -z "$COMBINED_SCRIPT" ]; then
24+ cleanup_redis
25+fi
+15-10
scripts/dev.sh
···3# Source the Postgres setup script
4source ./scripts/setup-postgres.sh
56-# Function to handle cleanup
7-cleanup_and_exit() {
8- echo "Cleaning up Postgres..."
9- cleanup_postgres
10- exit 0
11-}
001213-# Trap SIGINT and SIGTERM to cleanup on exit
14-trap cleanup_and_exit SIGINT SIGTERM
01516# Run the dev command
17npm run dev:app:inner
1819-# Cleanup after dev command exits
20-cleanup_postgres
00
···3# Source the Postgres setup script
4source ./scripts/setup-postgres.sh
56+# Only setup cleanup if not running from combined script
7+if [ -z "$COMBINED_SCRIPT" ]; then
8+ # Function to handle cleanup
9+ cleanup_and_exit() {
10+ echo "Cleaning up Postgres..."
11+ cleanup_postgres
12+ exit 0
13+ }
1415+ # Trap SIGINT and SIGTERM to cleanup on exit
16+ trap cleanup_and_exit SIGINT SIGTERM
17+fi
1819# Run the dev command
20npm run dev:app:inner
2122+# Only cleanup if not running from combined script
23+if [ -z "$COMBINED_SCRIPT" ]; then
24+ cleanup_postgres
25+fi