"use strict";
/**
 * penguins-eggs
 * krill modules: m-timezone.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"));
/**
 *
 * @param this
 */
async function mTimezone() {
    if (fs_1.default.existsSync('/etc/localtime')) {
        const cmd = `chroot ${this.installTarget} unlink /etc/localtime`;
        await (0, utils_1.exec)(cmd, this.echo);
    }
    const cmd = `chroot ${this.installTarget} ln -sf /usr/share/zoneinfo/${this.region}/${this.zone} /etc/localtime`;
    await (0, utils_1.exec)(cmd, this.echo);
}
exports.default = mTimezone;
