mirror of https://github.com/garrytan/gstack.git
Fix browse setup when Chromium is missing
This commit is contained in:
parent
1b317aae9a
commit
e29451aba3
|
|
@ -152,7 +152,7 @@ The browser automation layer is built on [Playwright](https://playwright.dev/) b
|
|||
### Prerequisites
|
||||
|
||||
- [Bun](https://bun.sh/) v1.0+
|
||||
- Playwright's Chromium (installed automatically by `bun install`)
|
||||
- Playwright's Chromium (installed by `./setup`, or manually via `bunx playwright install chromium`)
|
||||
|
||||
### Quick start
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ This is not a prompt pack for beginners. It is an operating system for people wh
|
|||
|
||||
## Install
|
||||
|
||||
**Requirements:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Git](https://git-scm.com/), [Bun](https://bun.sh/) v1.0+. `/browse` compiles a native binary — works on macOS and Linux (x64 and arm64).
|
||||
**Requirements:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Git](https://git-scm.com/), [Bun](https://bun.sh/) v1.0+. `/browse` compiles a native binary and `./setup` installs Playwright Chromium — works on macOS and Linux (x64 and arm64).
|
||||
|
||||
### Step 1: Install on your machine
|
||||
|
||||
|
|
@ -95,6 +95,7 @@ Real files get committed to your repo (not a submodule), so `git clone` just wor
|
|||
- Skill files (Markdown prompts) in `~/.claude/skills/gstack/` (or `.claude/skills/gstack/` for project installs)
|
||||
- Symlinks at `~/.claude/skills/browse`, `~/.claude/skills/review`, etc. pointing into the gstack directory
|
||||
- Browser binary at `browse/dist/browse` (~58MB, gitignored)
|
||||
- Playwright Chromium (installed by `./setup` if missing)
|
||||
- `node_modules/` (gitignored)
|
||||
- `/retro` saves JSON snapshots to `.context/retros/` in your project for trend tracking
|
||||
|
||||
|
|
|
|||
23
setup
23
setup
|
|
@ -6,6 +6,13 @@ GSTACK_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|||
SKILLS_DIR="$(dirname "$GSTACK_DIR")"
|
||||
BROWSE_BIN="$GSTACK_DIR/browse/dist/browse"
|
||||
|
||||
ensure_playwright_browser() {
|
||||
(
|
||||
cd "$GSTACK_DIR"
|
||||
bun --eval 'import { chromium } from "playwright"; const browser = await chromium.launch(); await browser.close();'
|
||||
) >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# 1. Build browse binary if needed
|
||||
NEEDS_BUILD=0
|
||||
if [ ! -x "$BROWSE_BIN" ]; then
|
||||
|
|
@ -32,7 +39,21 @@ if [ ! -x "$BROWSE_BIN" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Only create skill symlinks if we're inside a .claude/skills directory
|
||||
# 2. Ensure Playwright's Chromium is available for the browser daemon
|
||||
if ! ensure_playwright_browser; then
|
||||
echo "Installing Playwright Chromium..."
|
||||
(
|
||||
cd "$GSTACK_DIR"
|
||||
bunx playwright install chromium
|
||||
)
|
||||
fi
|
||||
|
||||
if ! ensure_playwright_browser; then
|
||||
echo "gstack setup failed: Playwright Chromium could not be launched" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 3. Only create skill symlinks if we're inside a .claude/skills directory
|
||||
SKILLS_BASENAME="$(basename "$SKILLS_DIR")"
|
||||
if [ "$SKILLS_BASENAME" = "skills" ]; then
|
||||
linked=()
|
||||
|
|
|
|||
Loading…
Reference in New Issue