"use strict";
/**
 * penguins-eggs
 * krill modules: machine-id.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 utils_1 = require("../../lib/utils");
const fs_1 = tslib_1.__importDefault(require("fs"));
/**
 * On Ubuntu
 * /etc/machine-id must exist to be re-created
 * https://unix.stackexchange.com/questions/402999/is-it-ok-to-change-etc-machine-id
 */
async function machineId() {
    const file = `${this.installTarget}/etc/machine-id`;
    if (fs_1.default.existsSync(file)) {
        await (0, utils_1.exec)(`rm ${file}`, this.echo);
    }
    await (0, utils_1.exec)(`touch ${file}`);
}
exports.default = machineId;
