@interopio/desktop-cli
Version:
CLI tool for setting up, building and packaging io.Connect Desktop projects
23 lines • 668 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.findPackageRoot = findPackageRoot;
const fs_1 = require("fs");
const path_1 = require("path");
function findPackageRoot() {
let dir = __dirname;
let found = false;
while (!found) {
if ((0, fs_1.existsSync)((0, path_1.join)(dir, "package.json"))) {
found = true;
}
else {
const parent = (0, path_1.dirname)(dir);
if (parent === dir) {
throw new Error("package.json not found");
}
dir = parent;
}
}
return dir;
}
//# sourceMappingURL=find.package.dir.js.map