mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-14 00:49:00 +02:00
fix(resolvers): stop env-var hosts from doubling $HOME in the binary fallback path
The browse/design/make-pdf setup resolvers built the fallback binary path as "$HOME" + dir.replace(/^~/, ''), which is only correct for ~-rooted dirs. Env-var hosts carry an absolute $GSTACK_* dir, so the generated fallback became $HOME$GSTACK_.../browse — a path that never exists. New toShellPath() in scripts/resolvers/types.ts expands ~ to $HOME and passes absolute env-var dirs through untouched; all five call sites route through it. Claude-host generated output is byte-identical, so no SKILL.md regeneration is needed here. Closes #2055. Contributed by @simjak (PR #2056). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
da6fd8bf25
commit
dcdd28ce34
@@ -71,6 +71,16 @@ function buildHostPaths(): Record<string, HostPaths> {
|
||||
|
||||
export const HOST_PATHS: Record<string, HostPaths> = buildHostPaths();
|
||||
|
||||
/**
|
||||
* Render a HostPaths binary dir as a shell-expandable absolute path.
|
||||
* Claude-style dirs are `~`-rooted (e.g. `~/.claude/skills/gstack/browse/dist`)
|
||||
* and expand via `$HOME`; env-var hosts already carry an absolute `$GSTACK_*`
|
||||
* value, so they pass through untouched — prepending `$HOME` would double it.
|
||||
*/
|
||||
export function toShellPath(dir: string): string {
|
||||
return dir.startsWith('~') ? `$HOME${dir.slice(1)}` : dir;
|
||||
}
|
||||
|
||||
import type { Model } from '../models';
|
||||
export type { Model } from '../models';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user