Nessuna descrizione
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.

target-apply.js 1.2KB

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const clc = require("colorette");
  5. const command_1 = require("../command");
  6. const logger_1 = require("../logger");
  7. const requireConfig_1 = require("../requireConfig");
  8. const utils = require("../utils");
  9. const error_1 = require("../error");
  10. exports.command = new command_1.Command("target:apply <type> <name> <resources...>")
  11. .description("apply a deploy target to a resource")
  12. .before(requireConfig_1.requireConfig)
  13. .action((type, name, resources, options) => {
  14. if (!options.project) {
  15. throw new error_1.FirebaseError(`Must have an active project to set deploy targets. Try ${clc.bold("firebase use --add")}`);
  16. }
  17. const changes = options.rc.applyTarget(options.project, type, name, resources);
  18. utils.logSuccess(`Applied ${type} target ${clc.bold(name)} to ${clc.bold(resources.join(", "))}`);
  19. for (const change of changes) {
  20. utils.logWarning(`Previous target ${clc.bold(change.target)} removed from ${clc.bold(change.resource)}`);
  21. }
  22. logger_1.logger.info();
  23. logger_1.logger.info(`Updated: ${name} (${options.rc.target(options.project, type, name).join(",")})`);
  24. });