No Description
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.

env.js 1.7KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.setEnvVarsForEmulators = void 0;
  4. const constants_1 = require("./constants");
  5. const types_1 = require("./types");
  6. const functionsEmulatorShared_1 = require("./functionsEmulatorShared");
  7. function setEnvVarsForEmulators(env, emulators) {
  8. for (const emu of emulators) {
  9. const host = (0, functionsEmulatorShared_1.formatHost)(emu);
  10. switch (emu.name) {
  11. case types_1.Emulators.FIRESTORE:
  12. env[constants_1.Constants.FIRESTORE_EMULATOR_HOST] = host;
  13. env[constants_1.Constants.FIRESTORE_EMULATOR_ENV_ALT] = host;
  14. break;
  15. case types_1.Emulators.DATABASE:
  16. env[constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST] = host;
  17. break;
  18. case types_1.Emulators.STORAGE:
  19. env[constants_1.Constants.FIREBASE_STORAGE_EMULATOR_HOST] = host;
  20. env[constants_1.Constants.CLOUD_STORAGE_EMULATOR_HOST] = `http://${host}`;
  21. break;
  22. case types_1.Emulators.AUTH:
  23. env[constants_1.Constants.FIREBASE_AUTH_EMULATOR_HOST] = host;
  24. break;
  25. case types_1.Emulators.HUB:
  26. env[constants_1.Constants.FIREBASE_EMULATOR_HUB] = host;
  27. break;
  28. case types_1.Emulators.PUBSUB:
  29. env[constants_1.Constants.PUBSUB_EMULATOR_HOST] = host;
  30. break;
  31. case types_1.Emulators.EVENTARC:
  32. env[constants_1.Constants.CLOUD_EVENTARC_EMULATOR_HOST] = `http://${host}`;
  33. break;
  34. }
  35. }
  36. }
  37. exports.setEnvVarsForEmulators = setEnvVarsForEmulators;