MCPcopy
hub / github.com/formatjs/formatjs / getWorkspaceRoot

Function getWorkspaceRoot

tools/generate-package-tsconfigs.ts:29–37  ·  view source on GitHub ↗
(args: Args)

Source from the content-addressed store, hash-verified

27const TSCONFIG_QUERY = 'kind("_tsconfig_file rule", //packages/...:*)'
28
29function getWorkspaceRoot(args: Args): string {
30 const dir = args['workspace-root'] ?? process.env.BUILD_WORKSPACE_DIRECTORY
31 if (!dir) {
32 throw new Error(
33 '--workspace-root or BUILD_WORKSPACE_DIRECTORY is required. Run via `bazel run` or set it explicitly.'
34 )
35 }
36 return dir
37}
38
39function labelToPath(label: string): string {
40 const trimmed = label.startsWith('//') ? label.slice(2) : label

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected