删除无用文档
This commit is contained in:
+3
-16
@@ -62,7 +62,6 @@ show_help() {
|
||||
|
||||
选项:
|
||||
--reset-db 重置数据库(删除并重建)
|
||||
--seed-only 仅重新同步基础数据
|
||||
--no-migrate 不执行数据库迁移
|
||||
--no-frontend 不启动前端
|
||||
--no-backend 不启动后端
|
||||
@@ -90,14 +89,12 @@ show_help() {
|
||||
示例:
|
||||
./scripts/dev.sh # 正常启动
|
||||
./scripts/dev.sh --reset-db # 重置数据库后启动(推荐迁移后使用)
|
||||
./scripts/dev.sh --seed-only # 重新同步基础数据
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
|
||||
# 参数解析
|
||||
RESET_DB="${DEV_RESET_DB:-0}"
|
||||
SEED_ONLY=0
|
||||
NO_MIGRATE=0
|
||||
NO_FRONTEND=0
|
||||
NO_BACKEND=0
|
||||
@@ -108,10 +105,6 @@ while [[ $# -gt 0 ]]; do
|
||||
RESET_DB=1
|
||||
shift
|
||||
;;
|
||||
--seed-only)
|
||||
SEED_ONLY=1
|
||||
shift
|
||||
;;
|
||||
--no-migrate)
|
||||
NO_MIGRATE=1
|
||||
shift
|
||||
@@ -546,13 +539,13 @@ watch_processes() {
|
||||
|
||||
main() {
|
||||
need_cmd docker
|
||||
if [[ "${SEED_ONLY}" != "1" && "${NO_BACKEND}" == "0" ]]; then
|
||||
if [[ "${NO_BACKEND}" == "0" ]]; then
|
||||
need_cmd go
|
||||
fi
|
||||
if [[ "${SEED_ONLY}" != "1" && "${NO_FRONTEND}" == "0" ]]; then
|
||||
if [[ "${NO_FRONTEND}" == "0" ]]; then
|
||||
need_cmd npm
|
||||
fi
|
||||
if [[ "${SEED_ONLY}" != "1" && ( "${NO_BACKEND}" == "0" || "${NO_FRONTEND}" == "0" ) ]]; then
|
||||
if [[ "${NO_BACKEND}" == "0" || "${NO_FRONTEND}" == "0" ]]; then
|
||||
need_cmd curl
|
||||
fi
|
||||
|
||||
@@ -575,12 +568,6 @@ main() {
|
||||
reset_database
|
||||
run_migrations
|
||||
|
||||
# 仅同步基础数据模式
|
||||
if [[ "${SEED_ONLY}" == "1" ]]; then
|
||||
log_success "基础数据同步完成,退出"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${NO_BACKEND}" == "0" ]]; then
|
||||
ensure_port_free "${BACKEND_PORT}" "后端"
|
||||
start_backend
|
||||
|
||||
Reference in New Issue
Block a user