"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 os_1 = __importDefault(require("os"));
var path_1 = __importDefault(require("path"));
var core_1 = __importDefault(require("./core"));
var fs = core_1.default.fse;
function getHomeDir() {
    var home = path_1.default.join(os_1.default.homedir(), '.s');
    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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9zdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxjQUFjOzs7Ozs7QUFFZCwwQ0FBb0I7QUFDcEIsOENBQXdCO0FBQ3hCLGdEQUEwQjtBQUNsQixJQUFLLEVBQUUsR0FBSyxjQUFJLElBQVQsQ0FBVTtBQUV6QixTQUFnQixVQUFVO0lBQ3hCLElBQU0sSUFBSSxHQUFHLGNBQUksQ0FBQyxJQUFJLENBQUMsWUFBRSxDQUFDLE9BQU8sRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzNDLElBQUksQ0FBQyxFQUFFLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxFQUFFO1FBQ3hCLEVBQUUsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDcEI7SUFDRCxPQUFPLElBQUksQ0FBQztBQUNkLENBQUM7QUFORCxnQ0FNQztBQUVELFNBQWdCLGNBQWM7SUFDNUIsSUFBTSxJQUFJLEdBQUcsY0FBSSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUNoRCxJQUFJLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUN4QixFQUFFLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3pCO0lBQ0QsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDO0FBTkQsd0NBTUM7QUFFRCxrQkFBZTtJQUNiLFVBQVUsWUFBQTtJQUNWLGNBQWMsZ0JBQUE7Q0FDZixDQUFDIn0=