mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
refactor(tools): support an explicit project directory
This commit is contained in:
1 parent
844c25212c
commit
6d5478ffa9
15 files changed
+169
-16
No files matched your search
@@ -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)), '..'),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user