MCPcopy Index your code
hub / github.com/garrytan/gstack / rewriteSectionBase

Function rewriteSectionBase

scripts/gen-skill-docs.ts:167–173  ·  view source on GitHub ↗

* When rendering to an out-dir, repoint the literal section-base path at the * out-dir so section Reads resolve to the rendered copy, not the global install. * Surgical: ONLY paths containing `/sections/` are rewritten — bin/, browse/, * docs/ references keep pointing at `~/.claude/skills/gstack`

(content: string)

Source from the content-addressed store, hash-verified

165 * install, which still works). No-op when --out-dir is unset.
166 */
167function rewriteSectionBase(content: string): string {
168 if (!OUT_DIR) return content;
169 return content.replace(
170 /~\/\.claude\/skills\/gstack\/([^\s)`"'*]+\/sections\/)/g,
171 `${OUT_DIR}/$1`,
172 );
173}
174
175// HostPaths, HOST_PATHS, and TemplateContext imported from ./resolvers/types (line 7-8)
176// Design constants (AI_SLOP_BLACKLIST, OPENAI_HARD_REJECTIONS, OPENAI_LITMUS_CHECKS)

Callers 2

processTemplateFunction · 0.85
processSectionTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected