index.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3. if (k2 === undefined) k2 = k;
  4. var desc = Object.getOwnPropertyDescriptor(m, k);
  5. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  6. desc = { enumerable: true, get: function() { return m[k]; } };
  7. }
  8. Object.defineProperty(o, k2, desc);
  9. }) : (function(o, m, k, k2) {
  10. if (k2 === undefined) k2 = k;
  11. o[k2] = m[k];
  12. }));
  13. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  14. Object.defineProperty(o, "default", { enumerable: true, value: v });
  15. }) : function(o, v) {
  16. o["default"] = v;
  17. });
  18. var __importStar = (this && this.__importStar) || function (mod) {
  19. if (mod && mod.__esModule) return mod;
  20. var result = {};
  21. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  22. __setModuleDefault(result, mod);
  23. return result;
  24. };
  25. Object.defineProperty(exports, "__esModule", { value: true });
  26. exports.ConfigNamespace = void 0;
  27. const utils_terminal_1 = require("@ionic/utils-terminal");
  28. const constants_1 = require("../../constants");
  29. const color_1 = require("../../lib/color");
  30. const namespace_1 = require("../../lib/namespace");
  31. class ConfigNamespace extends namespace_1.Namespace {
  32. async getMetadata() {
  33. const projectFile = this.project ? (0, utils_terminal_1.prettyPath)(this.project.filePath) : constants_1.PROJECT_FILE;
  34. return {
  35. name: 'config',
  36. summary: 'Manage CLI and project config values',
  37. description: `
  38. These commands are used to programmatically read, write, and delete CLI and project config values.
  39. By default, these commands use your project's ${(0, color_1.strong)((0, utils_terminal_1.prettyPath)(projectFile))} file.
  40. To use these commands for the global CLI config file (${(0, color_1.strong)('~/.ionic/config.json')}), use the ${(0, color_1.input)('--global')} flag.
  41. `,
  42. };
  43. }
  44. async getCommands() {
  45. return new namespace_1.CommandMap([
  46. ['get', async () => { const { ConfigGetCommand } = await Promise.resolve().then(() => __importStar(require('./get'))); return new ConfigGetCommand(this); }],
  47. ['set', async () => { const { ConfigSetCommand } = await Promise.resolve().then(() => __importStar(require('./set'))); return new ConfigSetCommand(this); }],
  48. ['unset', async () => { const { ConfigUnsetCommand } = await Promise.resolve().then(() => __importStar(require('./unset'))); return new ConfigUnsetCommand(this); }],
  49. ['delete', 'unset'],
  50. ['del', 'unset'],
  51. ]);
  52. }
  53. }
  54. exports.ConfigNamespace = ConfigNamespace;