UI for Zipcoin Blue

check.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const tslib_1 = require("tslib");
  4. const chalk_1 = require("chalk");
  5. const lib_1 = require("@ionic/cli-framework/lib");
  6. const command_1 = require("@ionic/cli-utils/lib/command");
  7. const errors_1 = require("@ionic/cli-utils/lib/errors");
  8. let DoctorCheckCommand = class DoctorCheckCommand extends command_1.Command {
  9. run(inputs, options) {
  10. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  11. const [id] = inputs;
  12. const { detectAndTreatAilment, registry, treatAilments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/index'));
  13. const { Ailments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/ailments'));
  14. const ailmentIds = Ailments.ALL.map(Ailment => new Ailment().id);
  15. if (id) {
  16. lib_1.validate(id, 'id', [lib_1.contains(ailmentIds, {})]);
  17. const ailment = registry.get(id);
  18. if (!ailment) {
  19. throw new errors_1.FatalException(`Issue not found by ID: ${chalk_1.default.green(id)}`);
  20. }
  21. yield detectAndTreatAilment(this.env, ailment);
  22. }
  23. else {
  24. yield treatAilments(this.env);
  25. }
  26. });
  27. }
  28. };
  29. DoctorCheckCommand = tslib_1.__decorate([
  30. command_1.CommandMetadata({
  31. name: 'check',
  32. type: 'project',
  33. description: 'Check the health of your Ionic project',
  34. inputs: [
  35. {
  36. name: 'id',
  37. description: 'The issue identifier',
  38. required: false,
  39. }
  40. ],
  41. })
  42. ], DoctorCheckCommand);
  43. exports.DoctorCheckCommand = DoctorCheckCommand;