~cytrogen/gstack

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