"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
const pacman_1 = tslib_1.__importDefault(require("./pacman"));
/**
 * cfs
 */
class CFS {
    /**
     * steps
     * @returns
     */
    async steps() {
        const cfs = [];
        let configRoot = '/etc/penguins-eggs.d/krill/';
        if (pacman_1.default.calamaresExists()) {
            configRoot = '/etc/calamares/';
        }
        // solo se esiste settings.conf  CALAMARES
        if (fs_1.default.existsSync(`${configRoot}settings.conf`)) {
            const settingsVar = fs_1.default.readFileSync(`${configRoot}settings.conf`, 'utf8');
            const settingsYaml = js_yaml_1.default.load(settingsVar);
            const execSequence = settingsYaml.sequence[1];
            const steps = execSequence.exec;
            for (const step of steps) {
                if (step.includes('cfs-')) {
                    cfs.push(step);
                }
            }
        }
        return cfs;
    }
}
exports.default = CFS;
