MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / copilotOnPath

Function copilotOnPath

src/installer/targets/copilot-cli.ts:83–97  ·  view source on GitHub ↗

* Best-effort check that the `copilot` binary is reachable on PATH. * A plain fs scan (no shell-out) — cheap enough to run inside * `detectAll()` for the multiselect prompt.

()

Source from the content-addressed store, hash-verified

81 * `detectAll()` for the multiselect prompt.
82 */
83function copilotOnPath(): boolean {
84 const pathVar = process.env.PATH || '';
85 const exts = process.platform === 'win32'
86 ? ['.exe', '.cmd', '.bat', '.ps1']
87 : [''];
88 for (const dir of pathVar.split(path.delimiter)) {
89 if (!dir) continue;
90 for (const ext of exts) {
91 try {
92 if (fs.existsSync(path.join(dir, 'copilot' + ext))) return true;
93 } catch { /* ignore unreadable PATH entries */ }
94 }
95 }
96 return false;
97}
98
99/**
100 * The shared stdio entry, every tool allowed, and `deferTools: 'never'`: Copilot CLI's tool

Callers 1

detectMethod · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected