#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cli = void 0;
const tslib_1 = require("tslib");
const log_1 = tslib_1.__importDefault(require("./utils/log"));
const path_1 = tslib_1.__importDefault(require("path"));
const cli = async (args) => {
    const [command] = args.slice(2);
    if (!command) {
        log_1.default.error('Provide command');
        return;
    }
    try {
        // eslint-disable-next-line global-require
        const commandFn = require(path_1.default.join(__dirname, `./commands/${command}.ts`));
        return commandFn.default(args.slice(3));
    }
    catch (err) {
        try {
            // eslint-disable-next-line global-require
            const commandFn = require(path_1.default.join(__dirname, `./commands/${command}.js`));
            return commandFn.default(args.slice(3));
        }
        catch (err) {
            log_1.default.error('Bad command');
        }
    }
};
exports.cli = cli;
exports.cli(process.argv);
//# sourceMappingURL=index.js.map