mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
11 lines
358 B
JavaScript
11 lines
358 B
JavaScript
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)), '..'),
|
|
);
|
|
}
|