UNPKG

@fimbul/wotan

Version:

Pluggable TypeScript and JavaScript linter

34 lines 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.module = void 0; const tslib_1 = require("tslib"); const configuration_manager_1 = require("../services/configuration-manager"); const base_1 = require("./base"); const inversify_1 = require("inversify"); const ymir_1 = require("@fimbul/ymir"); const utils_1 = require("../utils"); let ShowCommandRunner = class ShowCommandRunner extends base_1.AbstractCommandRunner { constructor(configManager, logger) { super(); this.configManager = configManager; this.logger = logger; } run(options) { const config = options.config === undefined ? this.configManager.find(options.file) : this.configManager.loadLocalOrResolved(options.config); if (config === undefined) throw new ymir_1.ConfigurationError(`Cannot find configuration for '${options.file}'.`); const reduced = this.configManager.reduce(config, options.file); this.logger.log(`${config.filename}\n${reduced === undefined ? 'File is excluded.' : utils_1.format(reduced, options.format)}`); return true; } }; ShowCommandRunner = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__metadata("design:paramtypes", [configuration_manager_1.ConfigurationManager, ymir_1.MessageHandler]) ], ShowCommandRunner); exports.module = new inversify_1.ContainerModule((bind) => { bind(base_1.AbstractCommandRunner).to(ShowCommandRunner); }); //# sourceMappingURL=show.js.map