dev #1
@ -1 +1 @@
|
|||||||
Subproject commit 1c2e578a8c07a0ad1fbf1d4cfca860ccdd6560c7
|
Subproject commit 845729228d988f6a6dca42f6ee57c3913ce3c82c
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 6e2b70c398ae59dd223152d31aa9dfe209f3d895
|
Subproject commit 771eb60ea444949139431bfc1408efa9a1bf518b
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 656a6e08da61b36b7ce4f50cf7f5fd568fa070bd
|
Subproject commit b59c7cef9bf20dae1857ef61a3e6c220f94dda76
|
||||||
25
run-dev.sh
25
run-dev.sh
@ -1,16 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Script to run all development servers concurrently
|
|
||||||
# Colors for output
|
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
BLUE='\033[0;34m'
|
BLUE='\033[0;34m'
|
||||||
MAGENTA='\033[0;35m'
|
MAGENTA='\033[0;35m'
|
||||||
CYAN='\033[0;36m'
|
CYAN='\033[0;36m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m'
|
||||||
|
|
||||||
# Function to cleanup processes on exit
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
echo -e "\n${YELLOW}Shutting down all services...${NC}"
|
echo -e "\n${YELLOW}Shutting down all services...${NC}"
|
||||||
kill $(jobs -p) 2>/dev/null
|
kill $(jobs -p) 2>/dev/null
|
||||||
@ -19,10 +16,8 @@ cleanup() {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set up trap to cleanup on script exit
|
|
||||||
trap cleanup EXIT INT TERM
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
# Function to run a service with colored output
|
|
||||||
run_service() {
|
run_service() {
|
||||||
local name=$1
|
local name=$1
|
||||||
local color=$2
|
local color=$2
|
||||||
@ -34,46 +29,36 @@ run_service() {
|
|||||||
(cd "$dir" && exec $cmd 2>&1 | sed "s/^/[$name] /" | while IFS= read -r line; do echo -e "${color}${line}${NC}"; done) &
|
(cd "$dir" && exec $cmd 2>&1 | sed "s/^/[$name] /" | while IFS= read -r line; do echo -e "${color}${line}${NC}"; done) &
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if required tools are installed
|
|
||||||
echo -e "${CYAN}Checking requirements...${NC}"
|
echo -e "${CYAN}Checking requirements...${NC}"
|
||||||
|
|
||||||
if ! command -v air &> /dev/null; then
|
if ! command -v air &> /dev/null; then
|
||||||
echo -e "${RED}Error: 'air' is not installed. Please install it first:${NC}"
|
echo -e "${RED}Error: 'air' is not installed"
|
||||||
echo "go install github.com/air-verse/air@latest"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v pnpm &> /dev/null; then
|
if ! command -v pnpm &> /dev/null; then
|
||||||
echo -e "${RED}Error: 'pnpm' is not installed. Please install it first:${NC}"
|
echo -e "${RED}Error: 'pnpm' is not installed}"
|
||||||
echo "npm install -g pnpm"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v deno &> /dev/null; then
|
if ! command -v deno &> /dev/null; then
|
||||||
echo -e "${RED}Error: 'deno' is not installed. Please install it first:${NC}"
|
echo -e "${RED}Error: 'deno' is not installed"
|
||||||
echo "curl -fsSL https://deno.land/x/install/install.sh | sh"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}All requirements satisfied${NC}\n"
|
echo -e "${GREEN}All requirements satisfied${NC}\n"
|
||||||
|
|
||||||
# Start all services
|
|
||||||
echo -e "${CYAN}Starting all development servers...${NC}\n"
|
echo -e "${CYAN}Starting all development servers...${NC}\n"
|
||||||
|
|
||||||
# Backend with air
|
|
||||||
run_service "Backend" "$GREEN" "hiling_go" air
|
run_service "Backend" "$GREEN" "hiling_go" air
|
||||||
|
|
||||||
# Meilisearch
|
|
||||||
run_service "Meilisearch" "$YELLOW" "hiling_go" ./dev-meilisearch.sh
|
run_service "Meilisearch" "$YELLOW" "hiling_go" ./dev-meilisearch.sh
|
||||||
|
|
||||||
# Frontend with pnpm
|
run_service "Frontend" "$BLUE" "hilingriviw" pnpm dev --host
|
||||||
run_service "Frontend" "$BLUE" "hilingriviw" pnpm dev
|
|
||||||
|
|
||||||
# OpenGraph with deno
|
|
||||||
run_service "OpenGraph" "$MAGENTA" "hiling-opengraph" deno task dev
|
run_service "OpenGraph" "$MAGENTA" "hiling-opengraph" deno task dev
|
||||||
|
|
||||||
echo -e "\n${CYAN}All services started!${NC}"
|
echo -e "\n${CYAN}All services started!${NC}"
|
||||||
echo -e "${CYAN}Press Ctrl+C to stop all services${NC}\n"
|
echo -e "${CYAN}Press Ctrl+C to stop all services${NC}\n"
|
||||||
|
|
||||||
# Wait for all background processes
|
|
||||||
wait
|
wait
|
||||||
Loading…
Reference in New Issue
Block a user