"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 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('[name]')
        .option('-t, --template [name]', 'Name of the Forge template to use')
        .option('-c, --copy-ci-files', 'Whether to copy the templated CI files (defaults to false)', false)
        .option('-f, --force', 'Whether to overwrite an existing directory (defaults to false)', false)
        .action((name) => {
        dir = (0, working_dir_1.default)(dir, name, false);
    })
        .parse(process.argv);
    const initOpts = {
        dir,
        interactive: true,
        copyCIFiles: !!commander_1.default.copyCiFiles,
        force: !!commander_1.default.force,
    };
    if (commander_1.default.template)
        initOpts.template = commander_1.default.template;
    await core_1.api.init(initOpts);
})();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxlY3Ryb24tZm9yZ2UtaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9lbGVjdHJvbi1mb3JnZS1pbml0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsZ0RBQXdCO0FBRXhCLCtDQUF3RDtBQUN4RCwwREFBZ0M7QUFDaEMsd0RBQTBCO0FBRTFCLDRCQUEwQjtBQUMxQixxRUFBNEM7QUFFNUMsQ0FBQyxLQUFLLElBQUksRUFBRTtJQUNWLElBQUksR0FBRyxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQztJQUN4QixtQkFBTztTQUNKLE9BQU8sQ0FBQyxDQUFDLE1BQU0sa0JBQUUsQ0FBQyxRQUFRLENBQUMs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