feat:完成微信公众号的自动化工具
This commit is contained in:
35
start.sh
Executable file
35
start.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
if [[ ! -f ".env" ]]; then
|
||||
if [[ -f ".env.example" ]]; then
|
||||
cp ".env.example" ".env"
|
||||
echo "Created .env from .env.example. Please fill required values if needed."
|
||||
else
|
||||
echo "Error: .env and .env.example are both missing."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if docker compose version >/dev/null 2>&1; then
|
||||
COMPOSE_CMD="docker compose"
|
||||
elif command -v docker-compose >/dev/null 2>&1; then
|
||||
COMPOSE_CMD="docker-compose"
|
||||
else
|
||||
echo "Error: docker compose is not available."
|
||||
echo "Install Docker Desktop first, then run this script again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting X2WeChat Studio..."
|
||||
$COMPOSE_CMD up --build -d
|
||||
|
||||
echo "Service is starting in background."
|
||||
echo "Open: http://localhost:18000"
|
||||
echo
|
||||
echo "Useful commands:"
|
||||
echo " $COMPOSE_CMD logs -f"
|
||||
echo " $COMPOSE_CMD down"
|
||||
Reference in New Issue
Block a user