1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- "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");
- const errors_1 = require("@ionic/cli-utils/lib/errors");
- let DoctorCheckCommand = class DoctorCheckCommand extends command_1.Command {
- run(inputs, options) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const [id] = inputs;
- const { detectAndTreatAilment, registry, treatAilments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/index'));
- const { Ailments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/ailments'));
- const ailmentIds = Ailments.ALL.map(Ailment => new Ailment().id);
- if (id) {
- lib_1.validate(id, 'id', [lib_1.contains(ailmentIds, {})]);
- const ailment = registry.get(id);
- if (!ailment) {
- throw new errors_1.FatalException(`Issue not found by ID: ${chalk_1.default.green(id)}`);
- }
- yield detectAndTreatAilment(this.env, ailment);
- }
- else {
- yield treatAilments(this.env);
- }
- });
- }
- };
- DoctorCheckCommand = tslib_1.__decorate([
- command_1.CommandMetadata({
- name: 'check',
- type: 'project',
- description: 'Check the health of your Ionic project',
- inputs: [
- {
- name: 'id',
- description: 'The issue identifier',
- required: false,
- }
- ],
- })
- ], DoctorCheckCommand);
- exports.DoctorCheckCommand = DoctorCheckCommand;
|