已改成自动处理端口占用:start 发现 2333 被占用会先执行 do_stop,再重试;如果还占用才报错退出。
Some checks failed
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-02-27 10:58:11 +08:00
parent 0e74c56caf
commit ee871021ef

8
run.sh
View File

@@ -41,9 +41,15 @@ function do_start() {
PORT_PID=$(lsof -t -i:2333) PORT_PID=$(lsof -t -i:2333)
if [ -n "$PORT_PID" ]; then if [ -n "$PORT_PID" ]; then
printf "${RED}错误: 端口 2333 已被占用尝试执<E8AF95><E689A7>?stop 后再启动${NC}\n" printf "${YELLOW}?? 2333 ??????????????...${NC}\n"
do_stop
sleep 1
PORT_PID=$(lsof -t -i:2333)
if [ -n "$PORT_PID" ]; then
printf "${RED}??: ?? 2333 ?????????????????${NC}\n"
return 1 return 1
fi fi
fi
printf "${GREEN}?? $PM ?? STARK Todo List (production)...${NC}\n" printf "${GREEN}?? $PM ?? STARK Todo List (production)...${NC}\n"
# 抑制安装输出保持界面整<E99DA2><E695B4>? $PM install > /dev/null 2>&1 # 抑制安装输出保持界面整<E99DA2><E695B4>? $PM install > /dev/null 2>&1