From 78cd60581dba4afb90618bb7630d64fbc0de3678 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 19 Apr 2026 11:07:15 +0200 Subject: [PATCH] scripts: add bd wrapper to x/; prepend $OLLIE/x/ to PATH in execute server The bd wrapper walks up from CWD to find a .beads directory and sets BEADS_DIR, so bd works from any subdirectory of a monorepo without the model needing to know about it. The execute server now always prepends $OLLIE/x/ to PATH for tool subprocesses, so wrappers placed there shadow system binaries transparently. Co-Authored-By: Claude Sonnet 4.6 --- mkfile | 3 ++- scripts/x/bd | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 scripts/x/bd diff --git a/mkfile b/mkfile index 1bf0947..7155dc1 100755 --- a/mkfile +++ b/mkfile @@ -48,7 +48,8 @@ scripts:V: cp -f scripts/b/cleanup $HOME/.config/ollie/scripts/b/cleanup cp -f scripts/u/optimize $HOME/.config/ollie/scripts/u/optimize cp -f scripts/x/elevate $HOME/.config/ollie/scripts/x/elevate - chmod 755 $HOME/.config/ollie/scripts/u/optimize $HOME/.config/ollie/scripts/x/elevate + cp -f scripts/x/bd $HOME/.config/ollie/scripts/x/bd + chmod 755 $HOME/.config/ollie/scripts/u/optimize $HOME/.config/ollie/scripts/x/elevate $HOME/.config/ollie/scripts/x/bd help:V: echo 'Ollie monorepo build targets:' diff --git a/scripts/x/bd b/scripts/x/bd new file mode 100644 index 0000000..0820e1b --- /dev/null +++ b/scripts/x/bd @@ -0,0 +1,14 @@ +#!/bin/bash +# Wrapper for bd that resolves BEADS_DIR by walking up from CWD when unset. +# Placed in $OLLIE/x/ so it shadows the real bd on PATH for tool subprocesses. +if [ -z "$BEADS_DIR" ]; then + dir="$PWD" + while [ "$dir" != "/" ]; do + if [ -d "$dir/.beads" ]; then + export BEADS_DIR="$dir/.beads" + break + fi + dir="$(dirname "$dir")" + done +fi +exec "$HOME/.local/bd" "$@"