80 lines
5.3 KiB
JavaScript
80 lines
5.3 KiB
JavaScript
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.debianArch = debianArch;
|
||
|
exports.default = void 0;
|
||
|
|
||
|
require("source-map-support/register");
|
||
|
|
||
|
var _makerBase = _interopRequireDefault(require("@electron-forge/maker-base"));
|
||
|
|
||
|
var _path = _interopRequireDefault(require("path"));
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||
|
|
||
|
function debianArch(nodeArch) {
|
||
|
switch (nodeArch) {
|
||
|
case 'ia32':
|
||
|
return 'i386';
|
||
|
|
||
|
case 'x64':
|
||
|
return 'amd64';
|
||
|
|
||
|
case 'armv7l':
|
||
|
return 'armhf';
|
||
|
|
||
|
case 'arm':
|
||
|
return 'armel';
|
||
|
|
||
|
default:
|
||
|
return nodeArch;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class MakerDeb extends _makerBase.default {
|
||
|
constructor(...args) {
|
||
|
super(...args);
|
||
|
|
||
|
_defineProperty(this, "name", 'deb');
|
||
|
|
||
|
_defineProperty(this, "defaultPlatforms", ['linux']);
|
||
|
|
||
|
_defineProperty(this, "requiredExternalBinaries", ['dpkg', 'fakeroot']);
|
||
|
}
|
||
|
|
||
|
isSupportedOnCurrentPlatform() {
|
||
|
return this.isInstalled('electron-installer-debian');
|
||
|
}
|
||
|
|
||
|
async make({
|
||
|
dir,
|
||
|
makeDir,
|
||
|
targetArch
|
||
|
}) {
|
||
|
// eslint-disable-next-line global-require, import/no-unresolved
|
||
|
const installer = require('electron-installer-debian');
|
||
|
|
||
|
const outDir = _path.default.resolve(makeDir, 'deb', targetArch);
|
||
|
|
||
|
await this.ensureDirectory(outDir);
|
||
|
const {
|
||
|
packagePaths
|
||
|
} = await installer({
|
||
|
options: {},
|
||
|
...this.config,
|
||
|
arch: debianArch(targetArch),
|
||
|
src: dir,
|
||
|
dest: outDir,
|
||
|
rename: undefined
|
||
|
});
|
||
|
return packagePaths;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
exports.default = MakerDeb;
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9NYWtlckRlYi50cyJdLCJuYW1lcyI6WyJkZWJpYW5BcmNoIiwibm9kZUFyY2giLCJNYWtlckRlYiIsIk1ha2VyQmFzZSIsImlzU3VwcG9ydGVkT25DdXJyZW50UGxhdGZvcm0iLCJpc0luc3RhbGxlZCIsIm1ha2UiLCJkaXIiLCJtYWtlRGlyIiwidGFyZ2V0QXJjaCIsImluc3RhbGxlciIsInJlcXVpcmUiLCJvdXREaXIiLCJwYXRoIiwicmVzb2x2ZSIsImVuc3VyZURpcmVjdG9yeSIsInBhY2thZ2VQYXRocyIsIm9wdGlvbnMiLCJjb25maWciLCJhcmNoIiwic3JjIiwiZGVzdCIsInJlbmFtZSIsInVuZGVmaW5lZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBOztBQUVBOzs7Ozs7QUFJTyxTQUFTQSxVQUFULENBQW9CQyxRQUFwQixFQUF5QztBQUM5QyxVQUFRQSxRQUFSO0FBQ0UsU0FBSyxNQUFMO0FBQWEsYUFBTyxNQUFQOztBQUNiLFNBQUssS0FBTDtBQUFZLGFBQU8sT0FBUDs7QUFDWixTQUFLLFFBQUw7QUFBZSxhQUFPLE9BQVA7O0FBQ2YsU0FBSyxLQUFMO0FBQVksYUFBTyxPQUFQOztBQUNaO0FBQVMsYUFBT0EsUUFBUDtBQUxYO0FBT0Q7O0FBRWMsTUFBTUMsUUFBTixTQUF1QkMsa0JBQXZCLENBQWlEO0FBQUE7QUFBQTs7QUFBQSxrQ0FDdkQ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