MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / classifyInstallSource

Function classifyInstallSource

apps/kimi-code/src/cli/update/source.ts:119–133  ·  view source on GitHub ↗
(
  packageRoot: string,
  globalPrefix: string,
  platform: NodeJS.Platform = process.platform,
)

Source from the content-addressed store, hash-verified

117}
118
119export function classifyInstallSource(
120 packageRoot: string,
121 globalPrefix: string,
122 platform: NodeJS.Platform = process.platform,
123): InstallSource {
124 const normalizedPackageRoot = normalizePathForComparison(packageRoot, platform);
125 if (normalizedPackageRoot === null) return 'unsupported';
126
127 for (const candidate of candidateGlobalPackageDirs(globalPrefix, platform)) {
128 if (normalizePathForComparison(candidate, platform) === normalizedPackageRoot) {
129 return 'npm-global';
130 }
131 }
132 return 'unsupported';
133}
134
135export async function detectInstallSource(
136 deps: Partial<DetectInstallSourceDeps> = {},

Callers 2

source.test.tsFile · 0.90
detectInstallSourceFunction · 0.85

Calls 2

Tested by

no test coverage detected