"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 fs_extra_1 = __importDefault(require("fs-extra"));
function getHomeDir() {
    var home = path_1.default.join(os_1.default.homedir(), '.s');
    if (!fs_extra_1.default.existsSync(home)) {
        fs_extra_1.default.mkdirSync(home);
    }
    return home;
}
exports.getHomeDir = getHomeDir;
function getHistoryFile() {
    var file = path_1.default.join(getHomeDir(), 'history');
    if (!fs_extra_1.default.existsSync(file)) {
        fs_extra_1.default.createFileSync(file);
    }
    return file;
}
exports.getHistoryFile = getHistoryFile;
exports.default = {
    getHomeDir: getHomeDir,
    getHistoryFile: getHistoryFile,
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9zdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxjQUFjOzs7Ozs7QUFFZCwwQ0FBb0I7QUFDcEIsOENBQXdCO0FBQ3hCLHNEQUEwQjtBQUUxQixTQUFnQixVQUFVO0lBQ3hCLElBQU0sSUFBSSxHQUFHLGNBQUksQ0FBQyxJQUFJLENBQUMsWUFBRSxDQUFDLE9BQU8sRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzNDLElBQUksQ0FBQyxrQkFBRSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUN4QixrQkFBRSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUNwQjtJQUNELE9BQU8sSUFBSSxDQUFDO0FBQ2QsQ0FBQztBQU5ELGdDQU1DO0FBRUQsU0FBZ0IsY0FBYztJQUM1QixJQUFNLElBQUksR0FBRyxjQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxFQUFFLFNBQVMsQ0FBQyxDQUFDO0lBQ2hELElBQUksQ0FBQyxrQkFBRSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsRUFBRTtRQUN4QixrQkFBRSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUN6QjtJQUNELE9BQU8sSUFBSSxDQUFDO0FBQ2QsQ0FBQztBQU5ELHdDQU1DO0FBSUQsa0JBQWU7SUFDYixVQUFVLFlBQUE7SUFDVixjQUFjLGdCQUFBO0NBQ2YsQ0FBQSJ9