diff --git a/07-start-frontend.sh b/07-start-frontend.sh index 59d9b54..84bdb35 100755 --- a/07-start-frontend.sh +++ b/07-start-frontend.sh @@ -127,6 +127,8 @@ _start_fe() { local pidfile="$PID_DIR/fe-${name}.pid" local logfile="$LOG_DIR/fe-${name}.log" + _check_fe_port_free "$name" || return 1 + # 已在运行 if [[ -f "$pidfile" ]] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then warn "$name 已在运行 (PID=$(cat "$pidfile")),跳过" @@ -156,8 +158,6 @@ _start_fe() { return 1 fi - _check_fe_port_free "$name" || return 1 - info "启动 ${BOLD}$name${NC} ..." if [[ "$name" == "pc" ]]; then pc_ensure_wasm_assets