"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.installer = void 0;
const tslib_1 = require("tslib");
const distro_1 = tslib_1.__importDefault(require("../../classes/distro"));
const pacman_1 = tslib_1.__importDefault(require("../../classes/pacman"));
/**
 *
 * @returns
 */
function installer() {
    const installer = {};
    // configRoot
    installer.configRoot = '';
    if (pacman_1.default.calamaresExists()) {
        installer.name = 'calamares';
        installer.configRoot = '/etc/calamares/';
        installer.multiarch = pacman_1.default.distro().usrLibPath + '/calamares/';
    }
    else {
        installer.name = 'krill';
        installer.configRoot = '/etc/penguins-eggs.d/krill/';
        installer.multiarch = pacman_1.default.distro().usrLibPath + '/krill/';
    }
    installer.modules = installer.configRoot + 'modules/';
    installer.multiarchModules = installer.multiarch + 'modules/';
    /**
     * se distro.isCalamaresAvailable()
     * i template di calamares e krill sono gli stessi
     */
    const remix = {};
    const distro = new distro_1.default(remix);
    if (distro.isCalamaresAvailable) {
        installer.template = '/etc/penguins-eggs.d/distros/' + distro.codenameLikeId + '/calamares/';
        if (distro.distroId === 'ManjaroLinux') {
            installer.template = '/etc/penguins-eggs.d/distros/' + distro.codenameLikeId + '/calamares-32/';
        }
        installer.templateModules = installer.template + 'modules/';
        installer.templateMultiarch = installer.template + 'calamares-modules/';
    }
    else {
        installer.template = '/etc/penguins-eggs.d/distros/' + distro.codenameLikeId + '/krill/';
        installer.templateModules = installer.template + 'modules/';
        installer.templateMultiarch = installer.template + 'krill-modules/';
    }
    return installer;
}
exports.installer = installer;
