tools,scripts: use -e not -d for .git boundary check
Submodules have .git as a file, not a directory. -d was stopping the walk immediately in submodule directories. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a960566ec9
commit
2d3d17237b
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue