Files
cursornew2026/backend/start.sh

21 lines
578 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
cd "$(dirname "$0")"
# 2. 杀掉占用端口的进程
pkill -f 'python run.py'
# 创建虚拟环境 (首次运行)
if [ ! -d "venv" ]; then
echo "创建虚拟环境..."
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
else
source venv/bin/activate
fi
# 启动服务 (端口8000, 关闭热重载)
echo "启动 CursorPro 后台 (端口: 8000)..."
RELOAD=false nohup python run.py > cursorpro.log 2>&1 &
echo $! > cursorpro.pid
echo "服务已启动PID: $(cat cursorpro.pid)"
echo "日志: tail -f cursorpro.log"