16 lines
447 B
JavaScript
16 lines
447 B
JavaScript
/**
|
|
* 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, "..", ".."));
|
|
}
|