mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-11 15:39:04 +02:00
fix(make-pdf): reject directories when resolving the browse binary
access(X_OK) is true for directories (they carry the execute/traverse bit on POSIX and pass the Windows existence check too), so cwd-dependent resolution could pick the ~/.claude/skills/browse alias DIRECTORY as the browse binary. Every browse call then exited 4 with empty stderr, which make-pdf surfaced as "Chromium failed to launch" against a perfectly healthy Chromium (#2156). Guard isExecutable with statSync().isFile() so only regular files qualify. Contributed by @jwilk-hrep (PR #2538). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
420b2f730d
commit
7ca68da785
@@ -158,6 +158,11 @@ export function resolveBrowseBin(env: NodeJS.ProcessEnv = process.env): string {
|
||||
|
||||
function isExecutable(p: string): boolean {
|
||||
try {
|
||||
// Must be a regular FILE. access(X_OK) alone is true for directories — they carry the
|
||||
// execute/traverse bit on POSIX and pass the Windows check too — so discovery happily
|
||||
// "found" ~/.claude/skills/browse, which is the skill's docs folder containing nothing
|
||||
// but SKILL.md, and returned a directory as the browse binary.
|
||||
if (!fs.statSync(p).isFile()) return false;
|
||||
fs.accessSync(p, fs.constants.X_OK);
|
||||
return true;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user