UI for Zipcoin Blue

ignore.js 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. let DoctorIgnoreCommand = class DoctorIgnoreCommand extends command_1.Command {
  8. preRun(inputs, options) {
  9. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  10. const { Ailments } = yield Promise.resolve().then(() => require('@ionic/cli-utils/lib/doctor/ailments'));
  11. const ailmentIds = Ailments.ALL.map(Ailment => new Ailment().id);
  12. if (!inputs[0]) {
  13. inputs[0] = yield this.env.prompt({
  14. type: 'list',
  15. name: 'id',
  16. message: 'Which issue would you like to ignore?',
  17. choices: ailmentIds,
  18. });
  19. }
  20. lib_1.validate(inputs[0], 'id', [lib_1.contains(ailmentIds, {})]);
  21. });
  22. }
  23. run(inputs, options) {
  24. return tslib_1.__awaiter(this, void 0, void 0, function* () {
  25. const [id] = inputs;
  26. const config = yield this.env.config.load();
  27. config.state.doctor.ignored.push(id);
  28. this.env.log.ok(`Ignored issue ${chalk_1.default.green(id)}`);
  29. });
  30. }
  31. };
  32. DoctorIgnoreCommand = tslib_1.__decorate([
  33. command_1.CommandMetadata({
  34. name: 'ignore',
  35. type: 'project',
  36. description: 'Ignore a particular issue',
  37. exampleCommands: [
  38. '',
  39. 'git-not-used',
  40. ],
  41. inputs: [
  42. {
  43. name: 'id',
  44. description: 'The issue identifier',
  45. },
  46. ],
  47. })
  48. ], DoctorIgnoreCommand);
  49. exports.DoctorIgnoreCommand = DoctorIgnoreCommand;