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

Function installDirCandidates

src/upgrade/remove-binary.ts:113–132  ·  view source on GitHub ↗

Candidate bundle install dirs: the running binary's own, plus the defaults.

(p: RemoveBinaryProbes)

Source from the content-addressed store, hash-verified

111
112/** Candidate bundle install dirs: the running binary's own, plus the defaults. */
113function installDirCandidates(p: RemoveBinaryProbes): string[] {
114 const P = pathFor(p.platform);
115 const dirs: string[] = [];
116 const method = detectInstallMethod({
117 filename: p.filename,
118 platform: p.platform,
119 cwd: p.cwd,
120 exists: p.exists,
121 });
122 if (method.kind === 'bundle' && method.installDir) dirs.push(method.installDir);
123 if (p.env.CODEGRAPH_INSTALL_DIR) dirs.push(p.env.CODEGRAPH_INSTALL_DIR);
124 // Platform defaults — probed even when the RUNNING binary is npm/source,
125 // because the whole point is clearing installs the user forgot about.
126 if (p.platform === 'win32') {
127 if (p.env.LOCALAPPDATA) dirs.push(P.join(p.env.LOCALAPPDATA, 'codegraph'));
128 } else {
129 dirs.push(stateDir(p));
130 }
131 return [...new Set(dirs.map((d) => P.resolve(d)))];
132}
133
134export function planBinaryRemoval(p: RemoveBinaryProbes): BinaryRemovalPlan {
135 const P = pathFor(p.platform);

Callers 1

planBinaryRemovalFunction · 0.85

Calls 5

detectInstallMethodFunction · 0.90
pathForFunction · 0.85
stateDirFunction · 0.85
resolveMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected