1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = findPodfilePath;
|
7 |
|
8 | function _cliTools() {
|
9 | const data = require("@react-native-community/cli-tools");
|
10 |
|
11 | _cliTools = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function _path() {
|
19 | const data = _interopRequireDefault(require("path"));
|
20 |
|
21 | _path = function () {
|
22 | return data;
|
23 | };
|
24 |
|
25 | return data;
|
26 | }
|
27 |
|
28 | var _findAllPodfilePaths = _interopRequireDefault(require("./findAllPodfilePaths"));
|
29 |
|
30 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | const TEST_PROJECTS = /test|example|sample/i;
|
41 |
|
42 | const IOS_BASE = 'ios';
|
43 |
|
44 | function findPodfilePath(cwd) {
|
45 | const podfiles = (0, _findAllPodfilePaths.default)(cwd)
|
46 | |
47 |
|
48 |
|
49 |
|
50 | .filter(project => _path().default.dirname(project) === IOS_BASE || !TEST_PROJECTS.test(project))
|
51 | |
52 |
|
53 |
|
54 | .sort(project => _path().default.dirname(project) === IOS_BASE ? -1 : 1);
|
55 |
|
56 | if (podfiles.length > 0) {
|
57 | if (podfiles.length > 1) {
|
58 | _cliTools().logger.warn((0, _cliTools().inlineString)(`
|
59 | Multiple Podfiles were found: ${podfiles}. Choosing ${podfiles[0]} automatically.
|
60 | If you would like to select a different one, you can configure it via "project.ios.sourceDir".
|
61 | You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
|
62 | `));
|
63 | }
|
64 |
|
65 | return _path().default.join(cwd, podfiles[0]);
|
66 | }
|
67 |
|
68 | return null;
|
69 | }
|
70 |
|
71 |
|
\ | No newline at end of file |