MCPcopy Create free account
hub / github.com/browserbase/stagehand / getRepoRootDir

Function getRepoRootDir

packages/docs/scripts/runtimePaths.js:91–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89export const getCurrentDirPath = () => path.dirname(getCurrentFilePath());
90
91export const getRepoRootDir = () => {
92 const currentFilePath = getCurrentFilePath();
93 const index = currentFilePath.lastIndexOf(PACKAGE_SEGMENT);
94 if (index === -1) {
95 throw new Error(
96 `Unable to determine repo root from ${currentFilePath} (missing ${PACKAGE_SEGMENT}).`,
97 );
98 }
99 return currentFilePath.slice(0, index);
100};
101
102export const isMainModule = () => {
103 const entryScript = process.argv.at(1);

Callers 15

test-utils.tsFile · 0.90
normalizeV8CoverageFunction · 0.90
build-cjs.tsFile · 0.90
coverage.tsFile · 0.90
test-e2e.tsFile · 0.90
test-core.tsFile · 0.90
build-esm.tsFile · 0.90
summary.tsFile · 0.90
browse_cli.tsFile · 0.90
runJsonMethod · 0.90
requireFromCorePackageFunction · 0.90

Calls 1

getCurrentFilePathFunction · 0.70

Tested by

no test coverage detected