"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.info = void 0;
const jsYamlLoader = require("../src/config/js-yaml-loader");
const ds_info_1 = require("../src/config/ds-info");
exports.info = (program) => {
    program
        .command('info')
        .description('print meta information about build and runtime')
        .option('-c, --config [file]', 'configuration file containing lib directory')
        .option('-l, --lib-dir [directory]', 'directory of libraries')
        .action(printMeta);
};
async function printMeta() {
    if (!this.libDir) {
        try {
            // @ts-ignore
            global.deepstreamCLI = this;
            await jsYamlLoader.loadConfigWithoutInitialization();
            // @ts-ignore
            this.libDir = global.deepstreamLibDir;
        }
        catch (e) {
            console.log(e);
            console.error('Please provide a libDir or a configFile to provide the relevant install information');
            process.exit(1);
        }
    }
    const dsInfo = await ds_info_1.getDSInfo(this.libDir);
    console.log(JSON.stringify(dsInfo, null, 2));
}
//# sourceMappingURL=deepstream-info.js.map