find-browse
21 lines · browse/bin/find-browse at 3f79d81
1#!/bin/bash
2# Shim: delegates to compiled find-browse binary, falls back to basic discovery.
3# The compiled binary handles git root detection for workspace-local installs.
4DIR="$(cd "$(dirname "$0")/.." && pwd)/dist"
5if test -x "$DIR/find-browse"; then
6 exec "$DIR/find-browse" "$@"
7fi
8# Fallback: basic discovery with priority chain
9ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
10for MARKER in .codex .agents .claude; do
11 if [ -n "$ROOT" ] && test -x "$ROOT/$MARKER/skills/gstack/browse/dist/browse"; then
12 echo "$ROOT/$MARKER/skills/gstack/browse/dist/browse"
13 exit 0
14 fi
15 if test -x "$HOME/$MARKER/skills/gstack/browse/dist/browse"; then
16 echo "$HOME/$MARKER/skills/gstack/browse/dist/browse"
17 exit 0
18 fi
19done
20echo "ERROR: browse binary not found. Run: cd <skill-dir> && ./setup" >&2
21exit 1