diff --git a/deploy.sh b/deploy.sh index d796bcb..208556b 100644 --- a/deploy.sh +++ b/deploy.sh @@ -477,7 +477,8 @@ do_deploy() { # ----- 事务前钩子:备份数据库(仅降级时备份) ----- BACKUP_DIR="" - if [ -n "$CURRENT_VERSION" ] && [ "$CURRENT_VERSION" != "0.0.0-dev" ]; then + # 仅当 CURRENT_VERSION 是有效版本格式时才进行版本比对 + if [ -n "$CURRENT_VERSION" ] && [ "$CURRENT_VERSION" != "0.0.0-dev" ] && [ "$CURRENT_VERSION" != "(首次部署)" ]; then compare_version "$CURRENT_VERSION" "$TARGET_VERSION" COMPARE_RESULT=$? if [ $COMPARE_RESULT -eq 2 ]; then