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

49 lines (38 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Publisher = undefined; var _bluebirdLstC; function _load_bluebirdLstC() { return _bluebirdLstC = require("bluebird-lst-c"); } var _uploader; function _load_uploader() { return _uploader = require("./uploader"); } var _fsExtraP; function _load_fsExtraP() { return _fsExtraP = require("fs-extra-p"); } var _path; function _load_path() { return _path = require("path"); } class Publisher { upload(file, artifactName) { var _this = this; return (0, (_bluebirdLstC || _load_bluebirdLstC()).coroutine)(function* () { const fileName = artifactName || (0, (_path || _load_path()).basename)(file); const fileStat = yield (0, (_fsExtraP || _load_fsExtraP()).stat)(file); yield _this.doUpload(fileName, fileStat.size, (_uploader || _load_uploader()).uploadFile.bind(_this, file, fileStat, fileName)); })(); } uploadData(data, fileName) { if (data == null || fileName == null) { throw new Error("data or fileName is null"); } return this.doUpload(fileName, data.length, it => it.end(data)); } } exports.Publisher = Publisher; //# sourceMappingURL=publisher.js.map