(dev script) Use tsconfig.json to tell we are at the root of the project

This commit is contained in:
garronej 2022-02-18 21:00:44 +01:00
parent e214280fcd
commit 3476b5acc3

View File

@ -2,7 +2,7 @@ import * as fs from "fs";
import * as path from "path";
function getProjectRootRec(dirPath: string): string {
if (fs.existsSync(path.join(dirPath, "package.json"))) {
if (fs.existsSync(path.join(dirPath, "tsconfig.json"))) {
return dirPath;
}
return getProjectRootRec(path.join(dirPath, ".."));