MCPcopy Create free account
hub / github.com/Snapchat/Valdi / resolveTarget

Method resolveTarget

npm_modules/cli/src/utils/BazelClient.ts:289–299  ·  view source on GitHub ↗
(pathStr: string)

Source from the content-addressed store, hash-verified

287 }
288
289 private async resolveTarget(pathStr: string): Promise<string> {
290 const absolutePath = path.resolve(pathStr);
291 const root = await this.getWorkspaceRoot();
292 if (!absolutePath.startsWith(root)) {
293 throw new Error(
294 `Could not resolve target at relative path, found Bazel workspace root at '${root}', resolved target path at ${absolutePath}`,
295 );
296 }
297
298 return '/' + absolutePath.slice(root.length);
299 }
300}

Callers 1

resolveLabelMethod · 0.95

Calls 3

getWorkspaceRootMethod · 0.95
startsWithMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected