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

Function findTelemetryBinary

browse/src/security.ts:400–415  ·  view source on GitHub ↗

* Try to locate the gstack-telemetry-log binary. Resolution order matches * the existing skill preamble pattern (never relies on PATH — packaged * binary layouts can break that). * * Order: * 1. ~/.claude/skills/gstack/bin/gstack-telemetry-log (global install) * 2. .claude/skills/gstack/bin

()

Source from the content-addressed store, hash-verified

398 * 3. bin/gstack-telemetry-log (in-repo dev)
399 */
400function findTelemetryBinary(): string | null {
401 const candidates = [
402 path.join(os.homedir(), '.claude', 'skills', 'gstack', 'bin', 'gstack-telemetry-log'),
403 path.resolve(process.cwd(), '.claude', 'skills', 'gstack', 'bin', 'gstack-telemetry-log'),
404 path.resolve(process.cwd(), 'bin', 'gstack-telemetry-log'),
405 ];
406 for (const c of candidates) {
407 try {
408 fs.accessSync(c, fs.constants.X_OK);
409 return c;
410 } catch {
411 // try next
412 }
413 }
414 return null;
415}
416
417/**
418 * Resolve a bash binary for invoking shebang scripts on Windows. Mirrors the

Callers 1

reportAttemptTelemetryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected