"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const FS = __importStar(require("fs"));
const Path = __importStar(require("path"));
const Utils = __importStar(require("../../../util/src"));
function updateStoreDB(path) {
    const rubikPath = Path.join(process.env.HOME ? process.env.HOME : '', `.antcube/rubik.json`);
    let rubik = {};
    if (!FS.existsSync(rubikPath)) {
        Utils.FS.mkdirs(Path.dirname(rubikPath));
    }
    else {
        rubik = JSON.parse(FS.readFileSync(rubikPath).toString());
    }
    rubik['CaseStore'] = path;
    FS.writeFileSync(rubikPath, JSON.stringify(rubik, undefined, 2));
    return Promise.resolve();
}
exports.updateStoreDB = updateStoreDB;
//# sourceMappingURL=index.js.map