MCPcopy Index your code
hub / github.com/QwikDev/qwik / rootDir

Method rootDir

packages/qwik/src/cli/utils/app-command.ts:19–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 }
18
19 get rootDir() {
20 if (!this._rootDir) {
21 const fsRoot = resolve('/');
22 let testDir = process.cwd();
23 for (let i = 0; i < 20; i++) {
24 const pkgPath = join(testDir, 'package.json');
25 if (existsSync(pkgPath)) {
26 this._rootDir = testDir;
27 break;
28 }
29 if (testDir === fsRoot) {
30 break;
31 }
32 testDir = dirname(testDir);
33 }
34 if (!this._rootDir) {
35 throw new Error(`Unable to find Qwik app package.json`);
36 }
37 }
38 return this._rootDir;
39 }
40
41 set rootDir(rootDir) {
42 this._rootDir = rootDir;

Callers

nothing calls this directly

Calls 3

joinFunction · 0.85
dirnameFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected