"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const core_1 = require("@electron-forge/core");
const get_1 = require("@electron/get");
const commander_1 = __importDefault(require("commander"));
const fs_extra_1 = __importDefault(require("fs-extra"));
require("./util/terminate");
const working_dir_1 = __importDefault(require("./util/working-dir"));
(async () => {
    let dir = process.cwd();
    commander_1.default
        .version((await fs_extra_1.default.readJson(path_1.default.resolve(__dirname, '../package.json'))).version)
        .arguments('[cwd]')
        .option('-a, --arch [arch]', 'Target architecture')
        .option('-p, --platform [platform]', 'Target build platform')
        .action((cwd) => {
        dir = (0, working_dir_1.default)(dir, cwd);
    })
        .parse(process.argv);
    (0, get_1.initializeProxy)();
    const packageOpts = {
        dir,
        interactive: true,
    };
    if (commander_1.default.arch)
        packageOpts.arch = commander_1.default.arch;
    if (commander_1.default.platform)
        packageOpts.platform = commander_1.default.platform;
    await core_1.api.package(packageOpts);
})();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxlY3Ryb24tZm9yZ2UtcGFja2FnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9lbGVjdHJvbi1mb3JnZS1wYWNrYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsZ0RBQXdCO0FBRXhCLCtDQUEyRDtBQUMzRCx1Q0FBZ0Q7QUFDaEQsMERBQWdDO0FBQ2hDLHdEQUEwQjtBQUUxQiw0QkFBMEI7QUFDMUIscUVBQTRDO0FBRTVDLENBQUMsS0FBSyxJQUFJLEVBQUU7SUFDVixJQUFJLEdBQUcsR0FBVyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7SUFDaEMsbUJBQU87U0FDSixPQUFPLENBQUMsQ0FBQyxNQUFNLGtCQUFFLENBQUMsUUFBUSxDQU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