This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
reValuate/node_modules/@expo/config/build/resolvePackageJson.js
2021-04-02 02:24:13 +03:00

22 lines
753 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_extra_1 = require("fs-extra");
const path_1 = require("path");
const Errors_1 = require("./Errors");
function fileExists(file) {
try {
return fs_extra_1.statSync(file).isFile();
}
catch (e) {
return false;
}
}
function getRootPackageJsonPath(projectRoot) {
const packageJsonPath = path_1.join(projectRoot, 'package.json');
if (!fileExists(packageJsonPath)) {
throw new Errors_1.ConfigError(`The expected package.json path: ${packageJsonPath} does not exist`, 'MODULE_NOT_FOUND');
}
return packageJsonPath;
}
exports.getRootPackageJsonPath = getRootPackageJsonPath;
//# sourceMappingURL=resolvePackageJson.js.map