diff --git a/scripts/watch-tenantapi-forlinux.sh b/scripts/watch-tenantapi-forlinux.sh index f759dbc..05a3c86 100755 --- a/scripts/watch-tenantapi-forlinux.sh +++ b/scripts/watch-tenantapi-forlinux.sh @@ -18,7 +18,8 @@ environment="${ASPNETCORE_ENVIRONMENT:-Development}" repo_root="" candidate_dir="${script_dir}" for _ in 0 1 2 3 4 5; do - if [ -f "${candidate_dir}/${project_path}" ] || [ -f "${candidate_dir}/TakeoutSaaS.sln" ]; then + # 必须同时满足:项目文件存在 且 sln 文件存在 + if [ -f "${candidate_dir}/${project_path}" ] && [ -f "${candidate_dir}/TakeoutSaaS.sln" ]; then repo_root="${candidate_dir}" break fi @@ -27,7 +28,7 @@ for _ in 0 1 2 3 4 5; do done if [ -z "${repo_root}" ]; then - echo "未找到仓库根目录(缺少 ${project_path} 或 TakeoutSaaS.sln),请在 TenantApi 仓库中运行该脚本。" >&2 + echo "未找到仓库根目录(需要同时存在 ${project_path} 和 TakeoutSaaS.sln),请在 TenantApi 仓库中运行该脚本。" >&2 exit 1 fi