UNPKG

electron-builder

Version:

A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box

64 lines (50 loc) 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readPackageJson = undefined; var _bluebirdLstC; function _load_bluebirdLstC() { return _bluebirdLstC = require("bluebird-lst-c"); } let readPackageJson = exports.readPackageJson = (() => { var _ref = (0, (_bluebirdLstC || _load_bluebirdLstC()).coroutine)(function* (file) { const data = yield (0, (_fsExtraP || _load_fsExtraP()).readJson)(file); yield authors(file, data); normalizeData(data); return data; }); return function readPackageJson(_x) { return _ref.apply(this, arguments); }; })(); let authors = (() => { var _ref2 = (0, (_bluebirdLstC || _load_bluebirdLstC()).coroutine)(function* (file, data) { if (data.contributors != null) { return; } let authorData = null; try { authorData = yield (0, (_fsExtraP || _load_fsExtraP()).readFile)((_path || _load_path()).resolve((_path || _load_path()).dirname(file), "AUTHORS"), "utf8"); } catch (ignored) { return; } data.contributors = authorData.split(/\r?\n/g).map(function (it) { return it.replace(/^\s*#.*$/, "").trim(); }); }); return function authors(_x2, _x3) { return _ref2.apply(this, arguments); }; })(); //# sourceMappingURL=readPackageJson.js.map var _path; function _load_path() { return _path = _interopRequireWildcard(require("path")); } var _fsExtraP; function _load_fsExtraP() { return _fsExtraP = require("fs-extra-p"); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } const normalizeData = require("normalize-package-data");