rush-sort-package-json
Version:
Rush plugin for sort package.json file in the project
26 lines • 955 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadRushConfiguration = void 0;
var rush_sdk_1 = require("@rushstack/rush-sdk");
var cwd2RushConfiguration = {};
var loadRushConfiguration = function (cwd) {
if (cwd === void 0) { cwd = process.cwd(); }
var rushConfiguration = cwd2RushConfiguration[cwd];
if (!rushConfiguration) {
try {
rushConfiguration = rush_sdk_1.RushConfiguration.loadFromDefaultLocation({
startingFolder: cwd,
});
if (!rushConfiguration) {
throw new Error("Rush configuration not found");
}
cwd2RushConfiguration[cwd] = rushConfiguration;
}
catch (e) {
throw new Error("Load rush configuration failed");
}
}
return rushConfiguration;
};
exports.loadRushConfiguration = loadRushConfiguration;
//# sourceMappingURL=loadRushConfiguration.js.map