UNPKG

howsmydriving-dummy

Version:
16 lines (15 loc) 595 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path = require("path"); var fs = require("fs"); function getAppRootPath() { var root_path = path.resolve(__dirname + '/../../'); if (!fs.existsSync(path.resolve(root_path, 'package.json'))) { root_path = path.resolve(__dirname + '/../../../'); if (!fs.existsSync(path.resolve(root_path, 'package.json'))) { throw new Error("Cannot find app root path containing package.json: " + __dirname + "."); } } return root_path; } exports.getAppRootPath = getAppRootPath;