설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

experiments-describe.js 1.5KB

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const colorette_1 = require("colorette");
  5. const command_1 = require("../command");
  6. const error_1 = require("../error");
  7. const experiments = require("../experiments");
  8. const logger_1 = require("../logger");
  9. const utils_1 = require("../utils");
  10. exports.command = new command_1.Command("experiments:describe <experiment>")
  11. .description("enable an experiment on this machine")
  12. .action((experiment) => {
  13. if (!experiments.isValidExperiment(experiment)) {
  14. let message = `Cannot find experiment ${(0, colorette_1.bold)(experiment)}`;
  15. const potentials = experiments.experimentNameAutocorrect(experiment);
  16. if (potentials.length === 1) {
  17. message = `${message}\nDid you mean ${potentials[0]}?`;
  18. }
  19. else if (potentials.length) {
  20. message = `${message}\nDid you mean ${potentials.slice(0, -1).join(",")} or ${(0, utils_1.last)(potentials)}?`;
  21. }
  22. throw new error_1.FirebaseError(message);
  23. }
  24. const spec = experiments.ALL_EXPERIMENTS[experiment];
  25. logger_1.logger.info(`${(0, colorette_1.bold)("Name")}: ${experiment}`);
  26. logger_1.logger.info(`${(0, colorette_1.bold)("Enabled")}: ${experiments.isEnabled(experiment) ? "yes" : "no"}`);
  27. if (spec.docsUri) {
  28. logger_1.logger.info(`${(0, colorette_1.bold)("Documentation")}: ${spec.docsUri}`);
  29. }
  30. logger_1.logger.info(`${(0, colorette_1.bold)("Description")}: ${spec.fullDescription || spec.shortDescription}`);
  31. });