fix: 修复 TenantApi watch 脚本仓库根目录识别逻辑
将条件从 || 改为 &&,确保必须同时找到项目文件和 sln 文件才认定为正确的仓库根目录,防止在错误的仓库中运行脚本。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user