findPodspec.js 907 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = findPodspec;
  6. function _glob() {
  7. const data = _interopRequireDefault(require("glob"));
  8. _glob = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _path() {
  14. const data = _interopRequireDefault(require("path"));
  15. _path = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21. function findPodspec(folder) {
  22. const podspecs = _glob().default.sync('*.podspec', {
  23. cwd: folder
  24. });
  25. if (podspecs.length === 0) {
  26. return null;
  27. }
  28. const packagePodspec = _path().default.basename(folder) + '.podspec';
  29. const podspecFile = podspecs.includes(packagePodspec) ? packagePodspec : podspecs[0];
  30. return _path().default.join(folder, podspecFile);
  31. }
  32. //# sourceMappingURL=findPodspec.js.map