installer: prefer CLI.py/pyproject markers for repo detection to avoid false positives in subdirs

This commit is contained in:
nose
2025-12-24 03:14:30 -08:00
parent 26e0d749d7
commit 17ebd9b46e

View File

@@ -367,10 +367,10 @@ python $cli @args
"# If the packaged REPO does not look valid at runtime, try to locate the repo by walking\n"
"# up from the current working directory so the launcher works when executed inside the\n"
"# project tree or when the global bin is symlinked into the repo.\n"
"if [ ! -f \"$REPO/CLI.py\" ] && [ ! -f \"$REPO/pyproject.toml\" ] && [ ! -f \"$REPO/setup.py\" ]; then\n"
"if [ ! -f \"$REPO/CLI.py\" ] && [ ! -f \"$REPO/pyproject.toml\" ]; then\n"
" CUR=\"$(pwd -P)\"\n"
" while [ \"$CUR\" != \"/\" ] && [ \"$CUR\" != \"\" ]; do\n"
" if [ -f \"$CUR/CLI.py\" ] || [ -f \"$CUR/pyproject.toml\" ] || [ -f \"$CUR/setup.py\" ]; then\n"
" if [ -f \"$CUR/CLI.py\" ] || [ -f \"$CUR/pyproject.toml\" ]; then\n"
" REPO=\"$CUR\"\n"
" break\n"
" fi\n"