MCPcopy Index your code
hub / github.com/github/awesome-copilot / resolveRepoPath

Function resolveRepoPath

extensions/java-modernization-studio/server.mjs:14–24  ·  view source on GitHub ↗
(ctx, lastWorkingDir)

Source from the content-addressed store, hash-verified

12
13/** Resolve which repo path an open/action context refers to, by precedence. */
14export function resolveRepoPath(ctx, lastWorkingDir) {
15 const fromInput =
16 ctx && ctx.input && typeof ctx.input.repoPath === "string" ? ctx.input.repoPath : null;
17 const fromSession =
18 ctx && ctx.session && ctx.session.workingDirectory ? ctx.session.workingDirectory : null;
19 // No process.cwd() fallback: that resolves to the extension's own directory,
20 // not the user's repo, and would make the cockpit scan unrelated files. When
21 // nothing resolves we return null and the UI shows a "repo not available"
22 // state instead of plausible-but-wrong data.
23 return fromInput || fromSession || lastWorkingDir || null;
24}
25
26/**
27 * Scan the repo and attach the environment readiness report. Tool probing is

Callers 2

extension.mjsFile · 0.90
cockpit.test.mjsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected