15 lines
358 B
Bash
Executable File
15 lines
358 B
Bash
Executable File
#!/bin/bash
|
|
# 重新编译并启动 Flutter Web (localhost:8080)
|
|
|
|
# 杀掉占用 8080 端口的进程
|
|
PID=$(lsof -ti:8080 2>/dev/null)
|
|
if [ -n "$PID" ]; then
|
|
echo "正在停止旧进程 (PID: $PID)..."
|
|
kill $PID 2>/dev/null
|
|
sleep 1
|
|
fi
|
|
|
|
echo "正在编译并启动 Flutter Web..."
|
|
cd "$(dirname "$0")"
|
|
flutter run -d web-server --web-port=8080 --no-pub
|