UNPKG

dbmaster-cli

Version:

Tool for converting tables between Fifa Soccer Games

24 lines (23 loc) 1.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConvertAction = void 0; const chalk_1 = __importDefault(require("chalk")); const actions_1 = require("../src/actions"); const config_1 = require("../src/config"); const interfaces_1 = require("../src/interfaces"); const abstract_action_1 = require("./abstract.action"); class ConvertAction extends abstract_action_1.AbstractAction { async handle(inputs, options) { const path = options.find((option) => option.name === 'config').value; const cfg = config_1.configFactory(path); for (const table of Object.values(interfaces_1.Table)) { console.info(chalk_1.default.green(`[${table}]`)); const list = await actions_1.actionFactory(cfg.tableConfig(table)); console.info('Converted :', chalk_1.default.yellow(list.length)); } } } exports.ConvertAction = ConvertAction;