1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- const tslib_1 = require("tslib");
- const chalk_1 = require("chalk");
- const lib_1 = require("@ionic/cli-framework/lib");
- const command_1 = require("@ionic/cli-utils/lib/command");
- let DoctorIgnoreCommand = class DoctorIgnoreCommand extends command_1.Command {
- preRun(inputs, options) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const { Ailments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/ailments'));
- const ailmentIds = Ailments.ALL.map(Ailment => new Ailment().id);
- if (!inputs[0]) {
- inputs[0] = yield this.env.prompt({
- type: 'list',
- name: 'id',
- message: 'Which issue would you like to ignore?',
- choices: ailmentIds,
- });
- }
- lib_1.validate(inputs[0], 'id', [lib_1.contains(ailmentIds, {})]);
- });
- }
- run(inputs, options) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const [id] = inputs;
- const config = yield this.env.config.load();
- config.state.doctor.ignored.push(id);
- this.env.log.ok(`Ignored issue ${chalk_1.default.green(id)}`);
- });
- }
- };
- DoctorIgnoreCommand = tslib_1.__decorate([
- command_1.CommandMetadata({
- name: 'ignore',
- type: 'project',
- description: 'Ignore a particular issue',
- exampleCommands: [
- '',
- 'git-not-used',
- ],
- inputs: [
- {
- name: 'id',
- description: 'The issue identifier',
- },
- ],
- })
- ], DoctorIgnoreCommand);
- exports.DoctorIgnoreCommand = DoctorIgnoreCommand;
|