UNPKG

zcatalyst-cli

Version:

Command Line Tool for CATALYST

56 lines (55 loc) 1.6 kB
'use strict'; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const conf_1 = __importDefault(require("conf")); const path_1 = require("path"); const path = process.env['X_ZC_CREDENTIAL_PATH']; class Store { static changeStore(store, path) { if (store === 'cli') { Store._store = new conf_1.default({ configName: 'zcatalyst-cli', projectName: 'zcatalyst-cli', cwd: path }); return; } Store._store = new conf_1.default({ configName: 'auth', projectName: 'zcatalyst-vscode', cwd: path ? (0, path_1.join)(path, 'zcatalyst-vscode') : undefined }); } static get istore() { return Store._store; } static get path() { return (0, path_1.join)(this._store.path, '../../'); } static get store() { return Store.istore.store; } static set store(val) { Store.istore.store = val; } static set(key, value) { return Store.istore.set(key, value); } static get(key, fallback) { return Store.istore.get(key, fallback); } static delete(key) { return Store.istore.delete(key); } static has(key) { return Store.istore.has(key); } } exports.default = Store; Store._store = new conf_1.default({ configName: 'zcatalyst-cli', projectName: 'zcatalyst-cli', cwd: path });