diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 1396be7..4553a22 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -419,10 +419,14 @@ set -e # REPO is injected at install time; if it doesn't look like a project, try to # find the repo by walking up from the current working directory. REPO="__REPO__" -if [ ! -f "$REPO/CLI.py" ] && [ ! -f "$REPO/pyproject.toml" ] && [ ! -f "$REPO/setup.py" ]; then +# If the embedded REPO does not contain a canonical project marker, search +# upward from the current working directory for a project root. Use only +# explicit project markers (CLI.py or pyproject.toml) to avoid false positives +# from subdirectories like 'scripts' which may contain their own setup.py. +if [ ! -f "$REPO/CLI.py" ] && [ ! -f "$REPO/pyproject.toml" ]; then CUR="$(pwd -P)" while [ "$CUR" != "/" ] && [ "$CUR" != "" ]; do - if [ -f "$CUR/CLI.py" ] || [ -f "$CUR/pyproject.toml" ] || [ -f "$CUR/setup.py" ]; then + if [ -f "$CUR/CLI.py" ] || [ -f "$CUR/pyproject.toml" ]; then REPO="$CUR" break fi