説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ext-sources-create.js 1.5KB

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
  5. const command_1 = require("../command");
  6. const projectUtils_1 = require("../projectUtils");
  7. const logger_1 = require("../logger");
  8. const extensionsHelper_1 = require("../extensions/extensionsHelper");
  9. const requirePermissions_1 = require("../requirePermissions");
  10. exports.command = new command_1.Command("ext:sources:create <sourceLocation>")
  11. .description(`create a extension source from sourceLocation`)
  12. .help("sourceLocation can be a local directory containing an extension, or URL pointing to a zipped extension. " +
  13. 'If using a URL, you can specify a root folder for the extension by adding "#<extensionRoot>". ' +
  14. "For example, if your extension.yaml is in the my/extension directory of the archive, " +
  15. "you should use sourceUrl#my/extension. If no extensionRoot is specified, / is assumed.")
  16. .before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
  17. .before(extensionsHelper_1.ensureExtensionsApiEnabled)
  18. .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
  19. .action(async (sourceLocation, options) => {
  20. const projectId = (0, projectUtils_1.needProjectId)(options);
  21. const res = await (0, extensionsHelper_1.createSourceFromLocation)(projectId, sourceLocation);
  22. logger_1.logger.info(`Extension source creation successful for ${res.spec.name}! Your new source is ${res.name}`);
  23. return res;
  24. });