"use strict";
/**
 * penguins-eggs
 * krill modules: remove-installer.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 * https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
 */
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
/**
   * removeInstallerLink
   */
async function removeInstallerLink() {
    const file = `${this.installTarget}/usr/bin/penguins-links-add.sh`;
    let lines = [];
    let content = '';
    if (fs_1.default.existsSync(file)) {
        lines = fs_1.default.readFileSync(file, { encoding: 'utf8', flag: 'r' }).split('\n');
        for (let i = 0; i < lines.length; i++) {
            if (lines[i]) {
                if (lines[i].search('penguins-krill.desktop') !== -1) {
                    lines[i] = '#' + lines[i];
                }
                if (lines[i].search('penguins-clinstaller.desktop') !== -1) {
                    lines[i] = '#' + lines[i];
                }
                if (lines[i].search('install-system.desktop') !== -1) {
                    lines[i] = '#' + lines[i];
                }
                content += lines[i] + '\n';
            }
        }
    }
    fs_1.default.writeFileSync(file, content);
}
exports.default = removeInstallerLink;
