refactor(tools): support an explicit project directory

This commit is contained in:
Sameh Khamis committed 2026-09-14 07:35:38 -07:00
1 parent 844c25212c
commit 6d5478ffa9
15 files changed
+169 -16

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
/** Resolve the explicit CLI project directory, defaulting to the tool's repository. */
export function projectRoot(moduleUrl, environment = process.env) {
return path.resolve(
environment.GEV_PROJECT_ROOT ||
path.join(path.dirname(fileURLToPath(moduleUrl)), '..'),
);
}