"use strict";
/**
 * penguins-eggs
 * krill modules: umount.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 = tslib_1.__importDefault(require("../../classes/utils"));
const utils_2 = require("../../lib/utils");
/**
*
* @param mountpoint
*/
async function umount(mountPoint = '') {
    let message = 'umount: ' + mountPoint;
    if (utils_1.default.isMountpoint(mountPoint)) {
        try {
            await (0, utils_2.exec)(`umount ${mountPoint} ${this.toNull}`, this.echo);
            await (0, utils_2.exec)('sleep 1', this.echo);
        }
        catch (error) {
            message += +mountPoint + JSON.stringify(error);
            await utils_1.default.pressKeyToExit(message);
        }
    }
}
exports.default = umount;
