How to use the @zowe/imperative.ImperativeConfig function in @zowe/imperative

To help you get started, we’ve selected a few @zowe/imperative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zowe / imperative / __tests__ / src / packages / imperative / plugins / test_plugins / normal_plugin_misc / lib / sample-plugin / cmd / imperative-config / imperativeConfig.handler.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            var loadedConfig = T.ImperativeConfig.instance.loadedConfig;
            var testCliConfig = require(__dirname + "/../../../../../../test_cli/TestConfiguration");

            if (loadedConfig != null) {
                params.response.console.log("Imperative configuration is accessible from the test plugin");
            } else {
                throw new T.ImperativeError({msg: "Imperative configuration is not accessible from the test plugin"});
            }

            if (loadedConfig.rootCommandDescription === testCliConfig.rootCommandDescription) {
                params.response.console.log("Imperative configuration does contain the expected rootCommandDescription");
            } else {
                throw new T.ImperativeError({msg: "Imperative configuration does not contain the expected rootCommandDescription"});
            }

            if (loadedConfig.defaultHome === testCliConfig.defaultHome) {
                params.response.console.log("Imperative configuration does contain the expected defaultHome");
github zowe / imperative / __tests__ / src / packages / imperative / plugins / test_plugins / normal_plugin_misc / lib / sample-plugin / cmd / imperative-logging / imperativeLogging.handler.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            var aLogger = T.Imperative.api.appLogger;
            aLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            aLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            aLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            aLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var iLogger = T.Imperative.api.imperativeLogger;
            iLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            iLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            iLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            iLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var config = T.ImperativeConfig.instance.loadedConfig;
            params.response.console.log(`${params.arguments.test}: Messages logged successfully to the following locations`);
            params.response.console.log(path.join(config.defaultHome, "imperative", "logs", "imperative.log"));
            params.response.console.log(path.join(config.defaultHome, config.name, "logs", config.name + ".log"));
        });
    }