createGroupWithMessage.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = createGroupWithMessage;
  6. function _cliTools() {
  7. const data = require("@react-native-community/cli-tools");
  8. _cliTools = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. var _createGroup = _interopRequireDefault(require("./createGroup"));
  14. var _getGroup = _interopRequireDefault(require("./getGroup"));
  15. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16. /**
  17. * Copyright (c) Facebook, Inc. and its affiliates.
  18. *
  19. * This source code is licensed under the MIT license found in the
  20. * LICENSE file in the root directory of this source tree.
  21. *
  22. */
  23. /**
  24. * Given project and path of the group, it checks if a group exists at that path,
  25. * and deeply creates a group for that path if its does not already exist.
  26. *
  27. * Returns the existing or newly created group
  28. */
  29. function createGroupWithMessage(project, path) {
  30. let group = (0, _getGroup.default)(project, path);
  31. if (!group) {
  32. group = (0, _createGroup.default)(project, path);
  33. _cliTools().logger.warn(`Group '${path}' does not exist in your Xcode project. We have created it automatically for you.`);
  34. }
  35. return group;
  36. }
  37. //# sourceMappingURL=createGroupWithMessage.js.map