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.

remoteconfig.js 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.doSetup = void 0;
  4. const prompt_1 = require("../../prompt");
  5. const fsutils = require("../../fsutils");
  6. const clc = require("colorette");
  7. async function doSetup(setup, config) {
  8. setup.config.remoteconfig = {};
  9. const jsonFilePath = await (0, prompt_1.promptOnce)({
  10. type: "input",
  11. name: "template",
  12. message: "What file should be used for your Remote Config template?",
  13. default: "remoteconfig.template.json",
  14. });
  15. if (fsutils.fileExistsSync(jsonFilePath)) {
  16. const msg = "File " +
  17. clc.bold(jsonFilePath) +
  18. " already exists." +
  19. " Do you want to overwrite the existing Remote Config template?";
  20. const overwrite = await (0, prompt_1.promptOnce)({
  21. type: "confirm",
  22. message: msg,
  23. default: false,
  24. });
  25. if (!overwrite) {
  26. return;
  27. }
  28. }
  29. setup.config.remoteconfig.template = jsonFilePath;
  30. config.writeProjectFile(setup.config.remoteconfig.template, "{}");
  31. }
  32. exports.doSetup = doSetup;