"use strict";
/** @format */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHistoryFile = exports.getHomeDir = void 0;
var path_1 = __importDefault(require("path"));
var core_1 = __importDefault(require("./core"));
var fs = core_1.default.fse, getRootHome = core_1.default.getRootHome;
function getHomeDir() {
    var home = getRootHome();
    if (!fs.existsSync(home)) {
        fs.mkdirSync(home);
    }
    return home;
}
exports.getHomeDir = getHomeDir;
function getHistoryFile() {
    var file = path_1.default.join(getHomeDir(), 'history');
    if (!fs.existsSync(file)) {
        fs.createFileSync(file);
    }
    return file;
}
exports.getHistoryFile = getHistoryFile;
exports.default = {
    getHomeDir: getHomeDir,
    getHistoryFile: getHistoryFile,
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9zdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxjQUFjOzs7Ozs7QUFFZCw4Q0FBd0I7QUFDeEIsZ0RBQTBCO0FBQ2xCLElBQUssRUFBRSxHQUFrQixjQUFJLElBQXRCLEVBQUUsV0FBVyxHQUFLLGNBQUksWUFBVCxDQUFVO0FBRXRDLFNBQWdCLFVBQVU7SUFDeEIsSUFBTSxJQUFJLEdBQUcsV0FBVyxFQUFFLENBQUM7SUFDM0IsSUFBSSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEVBQUU7UUFDeEIsRUFBRSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUNwQjtJQUNELE9BQU8sSUFBSSxDQUFDO0FBQ2QsQ0FBQztBQU5ELGdDQU1DO0FBRUQsU0FBZ0IsY0FBYztJQUM1QixJQUFNLElBQUksR0FBRyxjQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxFQUFFLFNBQVMsQ0FBQyxDQUFDO0lBQ2hELElBQUksQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxFQUFFO1FBQ3hCLEVBQUUsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDekI7SUFDRCxPQUFPLElBQUksQ0FBQztBQUNkLENBQUM7QUFORCx3Q0FNQztBQUVELGtCQUFlO0lBQ2IsVUFBVSxZQUFBO0lBQ1YsY0FBYyxnQkFBQTtDQUNmLENBQUMifQ==