rebase generation
This commit is contained in:
15
tools/lib/project-root.mjs
Normal file
15
tools/lib/project-root.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Resolve the KIS-TOiR project root directory.
|
||||
*
|
||||
* Works from any module file in the tools/ directory by walking up
|
||||
* relative to __dirname.
|
||||
*/
|
||||
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
export function getProjectRoot() {
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
// From tools/lib, go up two levels: ../.. = project root
|
||||
return path.resolve(path.join(__dirname, "..", ".."));
|
||||
}
|
||||
Reference in New Issue
Block a user