From 220b98da8fddc1a78d2ac6485af6cfb5d8d0e319 Mon Sep 17 00:00:00 2001 From: MSuMshk <173331402+msumshk@users.noreply.github.com> Date: Sat, 31 Jan 2026 11:38:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20TenantApi=20watch?= =?UTF-8?q?=20=E8=84=9A=E6=9C=AC=E4=BB=93=E5=BA=93=E6=A0=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=AF=86=E5=88=AB=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将条件从 || 改为 &&,确保必须同时找到项目文件和 sln 文件才认定为正确的仓库根目录,防止在错误的仓库中运行脚本。 Co-Authored-By: Claude Opus 4.5 --- scripts/watch-tenantapi-forlinux.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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