diff --git a/scripts/x/bd b/scripts/x/bd index 58e5a2d..921a544 100644 --- a/scripts/x/bd +++ b/scripts/x/bd @@ -3,7 +3,7 @@ # Placed in $OLLIE/x/ so it shadows the real bd on PATH for tool subprocesses. if [ -z "$BEADS_DIR" ]; then dir="$PWD" - while [ "$dir" != "/" ] && [ -d "$dir/.git" ]; do + while [ "$dir" != "/" ] && [ -e "$dir/.git" ]; do if [ -d "$dir/.beads" ]; then export BEADS_DIR="$dir/.beads" break diff --git a/tools/plan_check b/tools/plan_check index 43dffae..54b7387 100755 --- a/tools/plan_check +++ b/tools/plan_check @@ -10,7 +10,7 @@ if len(sys.argv) < 3: import shutil def _find_beads(): d = os.getcwd() - while d != os.path.dirname(d) and os.path.isdir(os.path.join(d, '.git')): + while d != os.path.dirname(d) and os.path.exists(os.path.join(d, '.git')): if os.path.isdir(os.path.join(d, '.beads')): return True d = os.path.dirname(d) diff --git a/tools/plan_create b/tools/plan_create index db38033..f3bf7d3 100755 --- a/tools/plan_create +++ b/tools/plan_create @@ -4,7 +4,7 @@ # Output: plan filename in pl/ set -euo pipefail -_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -d "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } +_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -e "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } if [ "${OLLIE_BEADS_ENABLE:-1}" != "0" ] && command -v bd >/dev/null 2>&1 && _find_beads; then echo "error: beads is available — use 'bd' for planning instead of plan_create" >&2 exit 2 diff --git a/tools/plan_finish b/tools/plan_finish index 8740f7e..2a5d656 100755 --- a/tools/plan_finish +++ b/tools/plan_finish @@ -11,7 +11,7 @@ if len(sys.argv) < 2: import shutil def _find_beads(): d = os.getcwd() - while d != os.path.dirname(d) and os.path.isdir(os.path.join(d, '.git')): + while d != os.path.dirname(d) and os.path.exists(os.path.join(d, '.git')): if os.path.isdir(os.path.join(d, '.beads')): return True d = os.path.dirname(d) diff --git a/tools/plan_start b/tools/plan_start index b2b9e85..2080d76 100755 --- a/tools/plan_start +++ b/tools/plan_start @@ -4,7 +4,7 @@ # Output: new filename set -euo pipefail -_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -d "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } +_find_beads() { local d="$PWD"; while [ "$d" != "/" ] && [ -e "$d/.git" ]; do [ -d "$d/.beads" ] && return 0; d="$(dirname "$d")"; done; return 1; } if [ "${OLLIE_BEADS_ENABLE:-1}" != "0" ] && command -v bd >/dev/null 2>&1 && _find_beads; then echo "error: beads is available — use 'bd' for planning instead of plan_start" >&2 exit 2